Пример #1
0
 void SendUpdates()
 {
     if (
         NotifyEnabled &&
         LowKey.IsAValidLowKey(HiKey, KeyCount) &&
         HiKey.IsAValidHiKey(LowKey, KeyCount)
         )
     {
         _onSwitchEditVmChanged.OnNext(this);
     }
 }
Пример #2
0
 public string this[string columnName]
 {
     get
     {
         if (columnName == "LowKey")
         {
             return((LowKey.IsAValidLowKey(HiKey, KeyCount)) ? null : " ");
         }
         if (columnName == "HiKey")
         {
             return((HiKey.IsAValidHiKey(LowKey, KeyCount)) ? null : " ");
         }
         return(null);
     }
 }
        protected override void ProcessRecord()
        {
            PartitionSchemeDescription partitionSchemeDescription;
            ServiceDescription         serviceDescription;
            var client = new ServiceFabricClientBuilder().ConnectAsync(ClusterEndPoint, ThumbPrint).Result;

            if (PartitionSchemeUniformInt64)
            {
                partitionSchemeDescription = new UniformInt64RangePartitionSchemeDescription(PartitionCount, LowKey.ToString(), HighKey.ToString());
            }
            else if (PartitionSchemeNamed)
            {
                partitionSchemeDescription = new NamedPartitionSchemeDescription(PartitionCount, PartitionNames);
            }
            else
            {
                partitionSchemeDescription = new SingletonPartitionSchemeDescription();
            }

            if (Stateless.IsPresent)
            {
                serviceDescription = new StatelessServiceDescription(new ServiceName(ServiceName), ServiceType, partitionSchemeDescription, InstanceCount, initializationData: InitializationData);
            }
            else
            {
                serviceDescription = new StatefulServiceDescription(new ServiceName(ServiceName), ServiceType, partitionSchemeDescription, TargetReplicaSetSize, MinReplicaSetSize, PersistedState, initializationData: InitializationData);
            }

            client.Services.CreateServiceAsync(ApplicationId, serviceDescription).Wait();
        }