예제 #1
0
        internal static unsafe PartitionSchemeDescription CreateFromNative(NativeTypes.FABRIC_PARTITION_SCHEME scheme, IntPtr ptr)
        {
            ReleaseAssert.AssertIfNot(scheme != NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_INVALID, StringResources.Error_PartitionSchemeNotSupported);

            switch (scheme)
            {
            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_SINGLETON:
                return(SingletonPartitionSchemeDescription.CreateFromNative(ptr));

            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_UNIFORM_INT64_RANGE:
                return(UniformInt64RangePartitionSchemeDescription.CreateFromNative(ptr));

            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_NAMED:
                return(NamedPartitionSchemeDescription.CreateFromNative(ptr));

            default:
                AppTrace.TraceSource.WriteError("ServicePartitionDescription.CreateFromNative", "Unknown scheme: {0}", scheme);
                ReleaseAssert.Failfast(string.Format(CultureInfo.CurrentCulture, StringResources.Error_PartitionSchemeUnknown_Formatted, scheme));
                break;
            }

            return(null);
        }
예제 #2
0
 internal NamedPartitionSchemeDescription(NamedPartitionSchemeDescription other)
     : base(other)
 {
     this.PartitionNames = new ItemList <string>(other.PartitionNames ?? new ItemList <string>());
 }