internal void ToNative(PinCollection pin, ref NativeTypes.FABRIC_CONTAINER_EVENT_DESCRIPTION nativeDesc)
 {
     nativeDesc.EventType          = InteropHelpers.ToNativeContainerEventType(this.EventType);
     nativeDesc.ContainerId        = pin.AddBlittable(this.ContainerId);
     nativeDesc.ContainerName      = pin.AddBlittable(this.ContainerName);
     nativeDesc.TimeStampInSeconds = this.TimeStampInSeconds;
     nativeDesc.IsHealthy          = NativeTypes.ToBOOLEAN(this.IsHealthy);
     nativeDesc.ExitCode           = this.ExitCode;
 }
        internal static IntPtr ToNativeList(PinCollection pin, List <ContainerEventDescription> eventDescList)
        {
            ReleaseAssert.AssertIfNot(
                eventDescList != null, "ContainerEventDescription.ToNativeList() has null eventDescList.");

            var nativeArray = new NativeTypes.FABRIC_CONTAINER_EVENT_DESCRIPTION[eventDescList.Count];

            for (int i = 0; i < eventDescList.Count; ++i)
            {
                eventDescList[i].ToNative(pin, ref nativeArray[i]);
            }

            var nativeList = new NativeTypes.FABRIC_CONTAINER_EVENT_DESCRIPTION_LIST
            {
                Count = (uint)eventDescList.Count,
                Items = pin.AddBlittable(nativeArray)
            };

            return(pin.AddBlittable(nativeList));
        }