Esempio n. 1
0
        internal override unsafe IntPtr ToNative(PinCollection pin, out NativeTypes.FABRIC_SERVICE_PARTITION_KIND kind)
        {
            var nativeDescription = new NativeTypes.FABRIC_NAMED_REPARTITION_DESCRIPTION[1];

            var toAddArray = new IntPtr[this.NamesToAdd.Count];

            for (var ix = 0; ix < toAddArray.Length; ++ix)
            {
                toAddArray[ix] = pin.AddObject(this.NamesToAdd[ix]);
            }
            nativeDescription[0].NamesToAddCount = (uint)toAddArray.Length;
            nativeDescription[0].NamesToAdd      = pin.AddBlittable(toAddArray);

            var toRemoveArray = new IntPtr[this.NamesToRemove.Count];

            for (var ix = 0; ix < toRemoveArray.Length; ++ix)
            {
                toRemoveArray[ix] = pin.AddObject(this.NamesToRemove[ix]);
            }
            nativeDescription[0].NamesToRemoveCount = (uint)toRemoveArray.Length;
            nativeDescription[0].NamesToRemove      = pin.AddBlittable(toRemoveArray);

            kind = NativeTypes.FABRIC_SERVICE_PARTITION_KIND.FABRIC_SERVICE_PARTITION_KIND_NAMED;

            return(pin.AddBlittable(nativeDescription));
        }
 abstract internal unsafe IntPtr ToNative(PinCollection pin, out NativeTypes.FABRIC_SERVICE_PARTITION_KIND kind);