Esempio n. 1
0
 internal WorkItemInfo GetWorkItemById(string workItemId)
 {
     WorkItemStatus[] array = (WorkItemStatus[])Enum.GetValues(typeof(WorkItemStatus));
     using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(this.WorkloadUri, this.Certificate))
     {
         WorkItemStatus[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             SymphonyTaskBase.< > c__DisplayClass7 CS$ < > 8__locals3 = new SymphonyTaskBase.< > c__DisplayClass7();
             CS$ < > 8__locals3.status = array2[i];
             WorkItemQueryResult result = new WorkItemQueryResult();
             WorkItemInfo        workItemInfo;
             do
             {
                 workloadClient.CallSymphony(delegate
                 {
                     result = workloadClient.Proxy.QueryWorkItems(null, null, null, CS$ < > 8__locals3.status, 1000, result.Bookmark);
                 }, this.WorkloadUri.ToString());
                 workItemInfo = result.WorkItems.SingleOrDefault((WorkItemInfo w) => string.Equals(w.WorkItemId, workItemId));
             }while (workItemInfo == null && result.HasMoreResults);
             if (workItemInfo != null)
             {
                 return(workItemInfo);
             }
         }
         throw new WorkItemNotFoundException(workItemId);
     }
Esempio n. 2
0
        override public bool VerifyProxy(ProxyWrapper proxywrapper)
        {
            var success = true;

            success = RetrieveMetadata(proxywrapper);
            return(success);
        }
Esempio n. 3
0
 public static void SetValidationStatus(Guid tenantId, ValidationStatus status, int?bugsId, string testTenantManagementUrl = "https://tws.365upgrade.microsoftonline.com/TestTenantManagementService.svc")
 {
     using (ProxyWrapper <TestTenantManagementClient, ITestTenantManagement> proxyWrapper = new ProxyWrapper <TestTenantManagementClient, ITestTenantManagement>(new Uri(testTenantManagementUrl), PopulationValidationUtils.TestTenantManagementCert))
     {
         proxyWrapper.Proxy.UpdateTenantValidationStatus(tenantId, status, bugsId);
     }
 }
Esempio n. 4
0
        private void CreateInnerChannel()
        {
            lock (this.m_channelLock)
            {
                if (InnerChannelFactory == null)
                {
                    throw new InvalidOperationException("Proxy invalid. This occurs when you use the default constructor.");
                }

                Logger.Info(string.Format("DataServicesProxyBase:CreateProxy:CreateInnerChannel: {0}", typeof(T)));

                m_channel = InnerChannelFactory.CreateChannel();

                var extendedProxy = new ProxyWrapper <T>(typeof(T), this);
                m_proxy = (T)extendedProxy.GetTransparentProxy();

                ICommunicationObject co = m_channel as ICommunicationObject;
                co.Faulted += InnerChannel_Faulted;
                co.Closed  += InnerChannel_Closed;
                co.Closing += InnerChannel_Closing;
                co.Opened  += InnerChannel_Opened;
                co.Opening += InnerChannel_Opening;

                /* Execute Register Callback Notification */
                InnerRegisterCallbacks?.Invoke();
            }
        }
Esempio n. 5
0
 protected override void InternalProcessRecord()
 {
     using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(base.WorkloadUri, base.Certificate))
     {
         workloadClient.CallSymphony(delegate
         {
             workloadClient.Proxy.UpdateWorkItem(this.retrievedWorkItem.WorkItemId, this.retrievedWorkItem.WorkItemStatus);
         }, base.WorkloadUri.ToString());
     }
 }
Esempio n. 6
0
 public void UpdateWorkItem(string workItemId, WorkItemStatusInfo status)
 {
     SymphonyProxy.< > c__DisplayClassf CS$ < > 8__locals1 = new SymphonyProxy.< > c__DisplayClassf();
     CS$ < > 8__locals1.workItemId = workItemId;
     CS$ < > 8__locals1.status     = status;
     using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(this.WorkloadUri, this.Cert))
     {
         workloadClient.CallSymphony(delegate
         {
             workloadClient.Proxy.UpdateWorkItem(CS$ < > 8__locals1.workItemId, CS$ < > 8__locals1.status);
         }, this.WorkloadUri.ToString());
Esempio n. 7
0
 override public bool VerifyProxy(ProxyWrapper proxywrapper)
 {
     //return RetrieveMetadata(proxywrapper);
     try
     {
         var serviceStatus = (proxywrapper.Proxy as ISampleSubmission).ServiceStatus(new ServiceStatusRequest());
         return(serviceStatus != null &&
                serviceStatus.ServiceStatus.systemstatus != null &&
                serviceStatus.ServiceStatus.systemstatus.systemstatus == statusType.OK);
     }
     catch { return(false); }
 }
Esempio n. 8
0
 public WorkItemInfo[] QueryTenantWorkItems(Guid tenantId)
 {
     WorkItemInfo[] result2;
     using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(this.WorkloadUri, this.Cert))
     {
         WorkItemInfo[] result = null;
         workloadClient.CallSymphony(delegate
         {
             result = workloadClient.Proxy.QueryTenantWorkItems(tenantId);
         }, this.WorkloadUri.ToString());
         result2 = result;
     }
     return(result2);
 }
Esempio n. 9
0
        public WorkItemQueryResult QueryWorkItems(string groupName, string tenantTier, string workItemType, WorkItemStatus status, int pageSize, byte[] bookmark)
        {
            WorkItemQueryResult result2;

            using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(this.WorkloadUri, this.Cert))
            {
                WorkItemQueryResult result = null;
                workloadClient.CallSymphony(delegate
                {
                    result = workloadClient.Proxy.QueryWorkItems(groupName, tenantTier, workItemType, status, pageSize, bookmark);
                }, this.WorkloadUri.ToString());
                result2 = result;
            }
            return(result2);
        }
Esempio n. 10
0
        public static List <Guid> GetTenantsBasedOnValidationStatus(ValidationStatus status, string testTenantManagementUrl = "https://tws.365upgrade.microsoftonline.com/TestTenantManagementService.svc", string serviceInstancePrefix = "Exchange/namprd03")
        {
            List <Guid> list = new List <Guid>();

            using (ProxyWrapper <TestTenantManagementClient, ITestTenantManagement> proxyWrapper = new ProxyWrapper <TestTenantManagementClient, ITestTenantManagement>(new Uri(testTenantManagementUrl), PopulationValidationUtils.TestTenantManagementCert))
            {
                Tenant[] array = proxyWrapper.Proxy.QueryTenantsToValidate(status);
                foreach (Tenant tenant in array)
                {
                    if (string.IsNullOrEmpty(serviceInstancePrefix) || tenant.ExchangeServiceInstance.StartsWith(serviceInstancePrefix, true, CultureInfo.InvariantCulture))
                    {
                        list.Add(tenant.TenantId);
                    }
                }
            }
            return(list);
        }
Esempio n. 11
0
        override public bool VerifyProxy(ProxyWrapper proxywrapper)
        {
            var success = true;

            //success = RetrieveMetadata(proxywrapper);

            try
            {
                var response = (proxywrapper.Proxy as IMetaDataService).GetMetadata((string[])VerifyProxyParameters[0],
                                                                                    (string)VerifyProxyParameters[1],
                                                                                    (bool)VerifyProxyParameters[2]);
                if (null != response)
                {
                    VerifyProxyResults = (response as metadataResponse).resultMessage;
                }
            }
            catch { success = false; }

            return(success);
        }
Esempio n. 12
0
        protected override void InternalProcessRecord()
        {
            SetConstraint.< > c__DisplayClass1 CS$ < > 8__locals1 = new SetConstraint.< > c__DisplayClass1();
            CS$ < > 8__locals1.toUpdate = null;
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "SingleConstraintUpdate"))
                {
                    if (parameterSetName == "MultiConstraintUpdate")
                    {
                        List <Constraint> list = new List <Constraint>();
                        foreach (PSObject psobject in this.Constraints)
                        {
                            string constraintName = base.GetPropertyValue(psobject.Properties, "ConstraintName").ToString();
                            string owner          = base.GetPropertyValue(psobject.Properties, "Owner").ToString();
                            string comment        = base.GetPropertyValue(psobject.Properties, "Comment").ToString();
                            bool   isBlocking;
                            bool.TryParse(base.GetPropertyValue(psobject.Properties, "IsBlocking").ToString(), out isBlocking);
                            int num;
                            int.TryParse(base.GetPropertyValue(psobject.Properties, "Status").ToString(), out num);
                            ConstraintStatus status = (ConstraintStatus)num;
                            DateTime         fixByDate;
                            DateTime.TryParse(base.GetPropertyValue(psobject.Properties, "FixByDate").ToString(), out fixByDate);
                            list.Add(new Constraint(constraintName, owner, fixByDate, status, isBlocking, comment));
                        }
                        CS$ < > 8__locals1.toUpdate = list.ToArray();
                    }
                }
                else
                {
                    Constraint constraint = new Constraint(this.Name, this.Owner, this.FixByDate, this.Status, this.IsBlocking, this.Comment);
                    CS$ < > 8__locals1.toUpdate = new Constraint[]
                    {
                        constraint
                    };
                }
            }
            using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
            {
                workloadClient.CallSymphony(delegate
                {
                    workloadClient.Proxy.UpdateConstraint(CS$ < > 8__locals1.toUpdate);
                }, base.WorkloadUri.ToString());
Esempio n. 13
0
 /// <summary>
 /// ラッパライブラリを初期化するためのメソッド。
 /// </summary>
 /// <param name="comProxy">JScriptとの通信に用いるJScriptオブジェクト。</param>
 public static void InitializeWrapper(object comProxy)
 {
     WrapperManager.proxy = new ProxyWrapper(comProxy);
 }
Esempio n. 14
0
 protected override void InternalProcessRecord()
 {
     using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
     {
         GroupCapacity[] groupCapacityResults = null;
         workloadClient.CallSymphony(delegate
         {
             groupCapacityResults = workloadClient.Proxy.QueryCapacity(this.Group);
         }, base.WorkloadUri.ToString());
         foreach (GroupCapacity groupCapacity in groupCapacityResults)
         {
             foreach (CapacityBlock capacity in groupCapacity.Capacities)
             {
                 base.WriteObject(new GroupCapacityDisplay(groupCapacity.GroupName, capacity));
             }
         }
     }
 }
Esempio n. 15
0
 protected override void InternalProcessRecord()
 {
     using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
     {
         Group[] groupResults = null;
         workloadClient.CallSymphony(delegate
         {
             groupResults = workloadClient.Proxy.QueryGroup(this.Name);
         }, base.WorkloadUri.ToString());
         base.WriteObject(groupResults);
     }
 }
Esempio n. 16
0
        protected override void InternalProcessRecord()
        {
            SetSymphonyGroup.< > c__DisplayClass1 CS$ < > 8__locals1 = new SetSymphonyGroup.< > c__DisplayClass1();
            CS$ < > 8__locals1.toUpdate = null;
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "SingleGroupUpdate"))
                {
                    if (parameterSetName == "MultiGroupUpdate")
                    {
                        List <Group> list = new List <Group>();
                        foreach (PSObject psobject in this.Groups)
                        {
                            string groupName = base.GetPropertyValue(psobject.Properties, "GroupName").ToString();
                            int    num;
                            int.TryParse(base.GetPropertyValue(psobject.Properties, "Region").ToString(), out num);
                            DataCenterRegion regionName = (DataCenterRegion)num;
                            list.Add(new Group(groupName, regionName));
                        }
                        CS$ < > 8__locals1.toUpdate = list.ToArray();
                    }
                }
                else
                {
                    Group group = new Group(this.Group, this.Region);
                    CS$ < > 8__locals1.toUpdate = new Group[]
                    {
                        group
                    };
                }
            }
            using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
            {
                workloadClient.CallSymphony(delegate
                {
                    workloadClient.Proxy.UpdateGroup(CS$ < > 8__locals1.toUpdate);
                }, base.WorkloadUri.ToString());
Esempio n. 17
0
        protected override void InternalProcessRecord()
        {
            SetGroupBlackout.< > c__DisplayClass1 CS$ < > 8__locals1 = new SetGroupBlackout.< > c__DisplayClass1();
            CS$ < > 8__locals1.toUpdate = null;
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "SingleGroupBlackoutUpdate"))
                {
                    if (parameterSetName == "MultiGroupBlackoutUpdate")
                    {
                        Dictionary <string, List <BlackoutInterval> > dictionary = new Dictionary <string, List <BlackoutInterval> >();
                        foreach (PSObject psobject in this.GroupBlackouts)
                        {
                            string   key    = base.GetPropertyValue(psobject.Properties, "GroupName").ToString();
                            string   reason = base.GetPropertyValue(psobject.Properties, "Reason").ToString();
                            DateTime startDate;
                            DateTime.TryParse(base.GetPropertyValue(psobject.Properties, "StartDate").ToString(), out startDate);
                            DateTime endDate;
                            DateTime.TryParse(base.GetPropertyValue(psobject.Properties, "EndDate").ToString(), out endDate);
                            if (dictionary.ContainsKey(key))
                            {
                                if (dictionary[key].Count >= 20)
                                {
                                    base.ThrowTerminatingError(new PSArgumentException("Cannot update more than 20 BlackoutIntervals per group"), ErrorCategory.InvalidArgument, this.GroupBlackouts);
                                }
                                dictionary[key].Add(new BlackoutInterval(startDate, endDate, reason));
                            }
                            else
                            {
                                dictionary.Add(key, new List <BlackoutInterval>
                                {
                                    new BlackoutInterval(startDate, endDate, reason)
                                });
                            }
                        }
                        List <GroupBlackout> list = new List <GroupBlackout>();
                        foreach (KeyValuePair <string, List <BlackoutInterval> > keyValuePair in dictionary)
                        {
                            list.Add(new GroupBlackout(keyValuePair.Key, keyValuePair.Value.ToArray()));
                        }
                        CS$ < > 8__locals1.toUpdate = list.ToArray();
                    }
                }
                else
                {
                    BlackoutInterval[] intervals;
                    if (this.BlackoutIntervals == null)
                    {
                        BlackoutInterval blackoutInterval = new BlackoutInterval(this.StartDate, this.EndDate, this.Reason);
                        intervals = new BlackoutInterval[]
                        {
                            blackoutInterval
                        };
                    }
                    else
                    {
                        intervals = this.BlackoutIntervals;
                    }
                    GroupBlackout groupBlackout = new GroupBlackout(this.Group, intervals);
                    CS$ < > 8__locals1.toUpdate = new GroupBlackout[]
                    {
                        groupBlackout
                    };
                }
            }
            using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
            {
                workloadClient.CallSymphony(delegate
                {
                    workloadClient.Proxy.UpdateBlackout(CS$ < > 8__locals1.toUpdate);
                }, base.WorkloadUri.ToString());
Esempio n. 18
0
 public SlipkaSteps(IObjectContainer objectContainer) : base(objectContainer)
 {
     ProxySteps          = new ProxySteps(objectContainer);
     ProxyAdministration = new Uri("http://localhost:4445");
     Wrapper             = new ProxyWrapper(ProxyAdministration);
 }
Esempio n. 19
0
 protected override void InternalProcessRecord()
 {
     using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
     {
         GroupBlackout[] groupBlackoutResults = null;
         workloadClient.CallSymphony(delegate
         {
             groupBlackoutResults = workloadClient.Proxy.QueryBlackout(this.Group);
         }, base.WorkloadUri.ToString());
         foreach (GroupBlackout groupBlackout in groupBlackoutResults)
         {
             foreach (BlackoutInterval blackout in groupBlackout.Intervals)
             {
                 base.WriteObject(new GroupBlackoutDisplay(groupBlackout.GroupName, blackout));
             }
         }
     }
 }
Esempio n. 20
0
 protected override void InternalProcessRecord()
 {
     using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
     {
         TenantReadiness[] readiness = null;
         workloadClient.CallSymphony(delegate
         {
             readiness = workloadClient.Proxy.QueryTenantReadiness(this.TenantID);
         }, base.WorkloadUri.ToString());
         base.WriteObject(readiness);
     }
 }
Esempio n. 21
0
        protected override void InternalProcessRecord()
        {
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "regularQuery"))
                {
                    if (!(parameterSetName == "tenantQuery"))
                    {
                        if (!(parameterSetName == "WorkItemIDQUery"))
                        {
                            goto IL_247;
                        }
                        goto IL_208;
                    }
                }
                else
                {
                    WorkItemStatus[] array = base.UserSpecifiedParameters.Contains("Status") ? this.Status : ((WorkItemStatus[])Enum.GetValues(typeof(WorkItemStatus)));
                    using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(base.WorkloadUri, base.Certificate))
                    {
                        WorkItemStatus[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            GetUpgradeWorkItem.< > c__DisplayClass4 CS$ < > 8__locals2 = new GetUpgradeWorkItem.< > c__DisplayClass4();
                            CS$ < > 8__locals2.status = array2[i];
                            WorkItemQueryResult queryResult = new WorkItemQueryResult();
                            bool flag;
                            do
                            {
                                workloadClient.CallSymphony(delegate
                                {
                                    queryResult = workloadClient.Proxy.QueryWorkItems(this.ForestName, this.TenantTier, this.Type, CS$ < > 8__locals2.status, 1000, queryResult.Bookmark);
                                }, base.WorkloadUri.ToString());
                                flag = this.WriteWorkitems(queryResult.WorkItems);
                            }while (queryResult.HasMoreResults && !flag);
                            if (flag)
                            {
                                break;
                            }
                        }
                        return;
                    }
                }
                using (ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler> workloadClient = new ProxyWrapper <UpgradeHandlerClient, IUpgradeHandler>(base.WorkloadUri, base.Certificate))
                {
                    if (this.Tenant == Guid.Empty)
                    {
                        throw new InvalidTenantGuidException(this.Tenant.ToString());
                    }
                    WorkItemInfo[] retrieved = null;
                    workloadClient.CallSymphony(delegate
                    {
                        retrieved = workloadClient.Proxy.QueryTenantWorkItems(this.Tenant);
                    }, base.WorkloadUri.ToString());
                    this.WriteWorkitems(retrieved);
                    return;
                }
IL_208:
                WorkItemInfo workItem;
                if (this.Tenant != Guid.Empty)
                {
                    workItem = base.GetWorkitemByIdAndTenantId(this.WorkItemID, this.Tenant);
                }
                else
                {
                    workItem = base.GetWorkItemById(this.WorkItemID);
                }
                this.WriteWorkItem(workItem);
                return;
            }
Esempio n. 22
0
        protected override void InternalProcessRecord()
        {
            SetTenantReadiness.< > c__DisplayClass1 CS$ < > 8__locals1 = new SetTenantReadiness.< > c__DisplayClass1();
            CS$ < > 8__locals1.toUpdate = null;
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "SingleTenantUpdate"))
                {
                    if (parameterSetName == "MultiTenantUpdate")
                    {
                        if (this.TenantReadinesses.Length > 500)
                        {
                            base.ThrowTerminatingError(new PSArgumentException("Cannot update more than 500 tenants at a time"), ErrorCategory.InvalidArgument, this.TenantReadinesses);
                        }
                        List <TenantReadiness> list = new List <TenantReadiness>();
                        foreach (PSObject psobject in this.TenantReadinesses)
                        {
                            string[] constraints = base.GetPropertyValue(psobject.Properties, "Constraints").ToString().Split(new char[]
                            {
                                ';'
                            }, StringSplitOptions.RemoveEmptyEntries);
                            string groupName = base.GetPropertyValue(psobject.Properties, "GroupName").ToString();
                            bool   isReady;
                            bool.TryParse(base.GetPropertyValue(psobject.Properties, "IsReady").ToString(), out isReady);
                            Guid tenantId = new Guid(base.GetPropertyValue(psobject.Properties, "TenantID").ToString());
                            int  upgradeUnits;
                            int.TryParse(base.GetPropertyValue(psobject.Properties, "UpgradeUnits").ToString(), out upgradeUnits);
                            bool useDefaultCapacity;
                            bool.TryParse(base.GetPropertyValue(psobject.Properties, "UseDefaultCapacity").ToString(), out useDefaultCapacity);
                            list.Add(new TenantReadiness(constraints, groupName, isReady, tenantId, upgradeUnits, useDefaultCapacity));
                        }
                        CS$ < > 8__locals1.toUpdate = list.ToArray();
                    }
                }
                else
                {
                    TenantReadiness tenantReadiness = new TenantReadiness(this.Constraints, this.Group, this.IsReady, this.TenantId, this.UpgradeUnits, this.UseDefaultCapacity);
                    CS$ < > 8__locals1.toUpdate = new TenantReadiness[]
                    {
                        tenantReadiness
                    };
                }
            }
            using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
            {
                workloadClient.CallSymphony(delegate
                {
                    workloadClient.Proxy.UpdateTenantReadiness(CS$ < > 8__locals1.toUpdate);
                }, base.WorkloadUri.ToString());
Esempio n. 23
0
        protected override void InternalProcessRecord()
        {
            SetGroupCapacity.< > c__DisplayClass1 CS$ < > 8__locals1 = new SetGroupCapacity.< > c__DisplayClass1();
            CS$ < > 8__locals1.toUpdate = null;
            string parameterSetName;

            if ((parameterSetName = base.ParameterSetName) != null)
            {
                if (!(parameterSetName == "SingleGroupCapacityUpdate"))
                {
                    if (parameterSetName == "MultiGroupCapacityUpdate")
                    {
                        Dictionary <string, List <CapacityBlock> > dictionary = new Dictionary <string, List <CapacityBlock> >();
                        foreach (PSObject psobject in this.GroupCapacities)
                        {
                            string text = base.GetPropertyValue(psobject.Properties, "GroupName").ToString();
                            int    upgradeUnits;
                            int.TryParse(base.GetPropertyValue(psobject.Properties, "UpgradeUnits").ToString(), out upgradeUnits);
                            DateTime startDate;
                            DateTime.TryParse(base.GetPropertyValue(psobject.Properties, "StartDate").ToString(), out startDate);
                            Console.WriteLine("Capacity Group name is {0}", text);
                            if (dictionary.ContainsKey(text))
                            {
                                Console.WriteLine("CSV Input Contains this groupname already");
                                if (dictionary[text].Count >= 20)
                                {
                                    base.ThrowTerminatingError(new PSArgumentException("Cannot update more than 20 capacities per group"), ErrorCategory.InvalidArgument, this.GroupCapacities);
                                }
                                dictionary[text].Add(new CapacityBlock(startDate, upgradeUnits));
                            }
                            else
                            {
                                Console.WriteLine("CSV Input is creating a new group name");
                                dictionary.Add(text, new List <CapacityBlock>
                                {
                                    new CapacityBlock(startDate, upgradeUnits)
                                });
                            }
                        }
                        List <GroupCapacity> list = new List <GroupCapacity>();
                        foreach (KeyValuePair <string, List <CapacityBlock> > keyValuePair in dictionary)
                        {
                            list.Add(new GroupCapacity(keyValuePair.Key, keyValuePair.Value.ToArray()));
                        }
                        CS$ < > 8__locals1.toUpdate = list.ToArray();
                    }
                }
                else
                {
                    CapacityBlock[] capacities;
                    if (this.CapacityBlocks == null)
                    {
                        CapacityBlock capacityBlock = new CapacityBlock(this.StartDate, this.UpgradeUnits);
                        capacities = new CapacityBlock[]
                        {
                            capacityBlock
                        };
                    }
                    else
                    {
                        capacities = this.CapacityBlocks;
                    }
                    GroupCapacity groupCapacity = new GroupCapacity(this.GroupName, capacities);
                    CS$ < > 8__locals1.toUpdate = new GroupCapacity[]
                    {
                        groupCapacity
                    };
                }
            }
            using (ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints> workloadClient = new ProxyWrapper <UpgradeSchedulingConstraintsClient, IUpgradeSchedulingConstraints>(base.WorkloadUri, base.Certificate))
            {
                workloadClient.CallSymphony(delegate
                {
                    workloadClient.Proxy.UpdateCapacity(CS$ < > 8__locals1.toUpdate);
                }, base.WorkloadUri.ToString());