/// <summary> /// Create a <see cref="VolumeEvent"/> to be populated from serialised data. /// </summary> /// <param name="eventType"> /// The type of container event represented by the serialised data. /// </param> /// <returns> /// The new <see cref="VolumeEvent"/>. /// </returns> VolumeEvent CreateVolumeEvent(DockerEventType eventType) { if (VolumeEventTypes.TryGetValue(eventType, out Type type)) { return((VolumeEvent)Activator.CreateInstance(type)); } return((VolumeEvent)Activator.CreateInstance(typeof(VolumeEvent), eventType)); }
/// <summary> /// Create a new <see cref="DockerEvent"/>. /// </summary> public DockerEvent(DockerEventTarget targetType, DockerEventType eventType) { TargetType = targetType; EventType = eventType; }
/// <summary> /// Initialise the <see cref="ImageEvent"/>. /// </summary> public ImageEvent(DockerEventType eventType) : base(DockerEventTarget.Image, eventType) { }
/// <summary> /// Initialise the <see cref="VolumeEvent"/>. /// </summary> public VolumeEvent(DockerEventType eventType) : base(DockerEventTarget.Volume, eventType) { }
/// <summary> /// Initialise the <see cref="ContainerEvent"/>. /// </summary> public ContainerEvent(DockerEventType eventType) : base(DockerEventTarget.Container, eventType) { }
/// <summary> /// Initialise the <see cref="NetworkEvent"/>. /// </summary> public NetworkEvent(DockerEventType eventType) : base(DockerEventTarget.Network, eventType) { }