internal override unsafe IntPtr ToNative(PinCollection pinCollection) { var nativeStoppedEvent = new NativeTypes.FABRIC_STOPPED_EVENT { TimeStampUtc = NativeTypes.ToNativeFILETIME(this.TimeStampUtc), Reason = pinCollection.AddObject(this.Reason) }; return(pinCollection.AddBlittable(nativeStoppedEvent)); }
internal static unsafe StoppedEvent FromNative(IntPtr nativeRaw) { if (nativeRaw == IntPtr.Zero) { return(null); } NativeTypes.FABRIC_STOPPED_EVENT native = *(NativeTypes.FABRIC_STOPPED_EVENT *)nativeRaw; var timeStamp = NativeTypes.FromNativeFILETIME(native.TimeStampUtc); string reason = NativeTypes.FromNativeString(native.Reason); return(new StoppedEvent(timeStamp, reason)); }