/// <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));
        }
示例#2
0
 /// <summary>
 ///     Create a new <see cref="DockerEvent"/>.
 /// </summary>
 public DockerEvent(DockerEventTarget targetType, DockerEventType eventType)
 {
     TargetType = targetType;
     EventType  = eventType;
 }
示例#3
0
 /// <summary>
 ///		Initialise the <see cref="ImageEvent"/>.
 /// </summary>
 public ImageEvent(DockerEventType eventType)
     : base(DockerEventTarget.Image, eventType)
 {
 }
示例#4
0
 /// <summary>
 ///		Initialise the <see cref="VolumeEvent"/>.
 /// </summary>
 public VolumeEvent(DockerEventType eventType)
     : base(DockerEventTarget.Volume, eventType)
 {
 }
示例#5
0
 /// <summary>
 ///		Initialise the <see cref="ContainerEvent"/>.
 /// </summary>
 public ContainerEvent(DockerEventType eventType)
     : base(DockerEventTarget.Container, eventType)
 {
 }
示例#6
0
 /// <summary>
 ///		Initialise the <see cref="NetworkEvent"/>.
 /// </summary>
 public NetworkEvent(DockerEventType eventType)
     : base(DockerEventTarget.Network, eventType)
 {
 }