示例#1
0
 public static bool IsValidExpression(string expression)
 {
     using (var pin = new PinCollection())
     {
         return(NativeTypes.FromBOOLEAN(NativeCommon.FabricIsValidExpression(pin.AddBlittable(expression))));
     }
 }
示例#2
0
            internal static IntPtr ToNative(PinCollection pin, ServiceGroupDescription description)
            {
                if (description == null)
                {
                    return(IntPtr.Zero);
                }

                uint length            = (uint)description.MemberDescriptions.Count;
                var  nativeDescription = new NativeTypes.FABRIC_SERVICE_GROUP_DESCRIPTION[1];

                nativeDescription[0].Description = description.ServiceDescription.ToNative(pin);
                nativeDescription[0].MemberCount = length;

                var members = new NativeTypes.FABRIC_SERVICE_GROUP_MEMBER_DESCRIPTION[length];

                for (int i = 0; i < length; i++)
                {
                    members[i].ServiceTypeName = pin.AddBlittable(description.MemberDescriptions[i].ServiceTypeName);
                    members[i].ServiceName     = pin.AddObject(description.MemberDescriptions[i].ServiceName);

                    var initializationData = NativeTypes.ToNativeBytes(pin, description.MemberDescriptions[i].InitializationData);
                    members[i].InitializationDataSize = initializationData.Item1;
                    members[i].InitializationData     = initializationData.Item2;

                    var metrics = NativeTypes.ToNativeLoadMetrics(pin, description.MemberDescriptions[i].Metrics);
                    members[i].MetricCount = metrics.Item1;
                    members[i].Metrics     = metrics.Item2;

                    pin.AddBlittable(members[i]);
                }

                nativeDescription[0].MemberDescriptions = pin.AddBlittable(members);
                return(pin.AddBlittable(nativeDescription[0]));
            }
示例#3
0
 // Copies the exception message and stack trace to ErrorThreadMessage
 public void HandleException(Exception ex)
 {
     if (this.CopyExceptionDetailsToThreadErrorMessage)
     {
         using (var pin = new PinCollection())
         {
             NativeCommon.FabricSetLastErrorMessage(pin.AddObject(CreateThreadErrorMessage(ex, this.ShouldIncludeStackTraceInThreadErrorMessage)));
         }
     }
 }
示例#4
0
            internal static IntPtr ToNative(PinCollection pin, ServiceGroupUpdateDescription updateDescription)
            {
                if (updateDescription == null)
                {
                    return(IntPtr.Zero);
                }

                var nativeDescription = new NativeTypes.FABRIC_SERVICE_GROUP_UPDATE_DESCRIPTION[1];

                nativeDescription[0].UpdateDescription = updateDescription.ServiceUpdateDescription.ToNative(pin);

                return(pin.AddBlittable(nativeDescription[0]));
            }
示例#5
0
 public StringListResult(IList <string> list)
 {
     pinCollection = new PinCollection();
     items         = NativeTypes.ToNativeStringPointerArray(pinCollection, list);
     count         = (UInt32)list.Count;
 }
示例#6
0
 public abstract NativeType ToNative(PinCollection pin);