@classmethod
def FromEventData(cls, event_data):
    """Creates a service object from event data.

    Args:
      event_data (EventData): event data.

    Returns:
      WindowsService: service.
    """
    if event_data.pathspec:
        source = event_data.pathspec.location, event_data.key_path
    else:
        source = 'Unknown', 'Unknown'
    return cls(event_data.name, event_data.service_type, event_data.
        image_path, event_data.start_type, event_data.object_name, source,
        service_dll=event_data.service_dll)
