public IEnumerable<AffinityGroup> GetAffinityGroupProcess(out Operation operation)
		{
			IEnumerable<AffinityGroup> affinityGroups;
			Func<string, AffinityGroup> func = null;
			Func<string, AffinityGroupList> func1 = null;
			IEnumerable<AffinityGroup> affinityGroups1 = null;
			operation = null;
			using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel))
			{
				try
				{
					if (this.Name == null)
					{
						GetAzureAffinityGroupCommand getAzureAffinityGroupCommand = this;
						if (func1 == null)
						{
							func1 = (string s) => base.Channel.ListAffinityGroups(s);
						}
						affinityGroups1 = ((CmdletBase<IServiceManagement>)getAzureAffinityGroupCommand).RetryCall<AffinityGroupList>(func1);
					}
					else
					{
						AffinityGroup[] affinityGroupArray = new AffinityGroup[1];
						AffinityGroup[] affinityGroupArray1 = affinityGroupArray;
						int num = 0;
						GetAzureAffinityGroupCommand getAzureAffinityGroupCommand1 = this;
						if (func == null)
						{
							func = (string s) => base.Channel.GetAffinityGroup(s, this.Name);
						}
						affinityGroupArray1[num] = ((CmdletBase<IServiceManagement>)getAzureAffinityGroupCommand1).RetryCall<AffinityGroup>(func);
						affinityGroups1 = affinityGroupArray;
					}
					operation = base.WaitForOperation(base.CommandRuntime.ToString());
				}
				catch (CommunicationException communicationException1)
				{
					CommunicationException communicationException = communicationException1;
					if (communicationException as EndpointNotFoundException == null || base.IsVerbose())
					{
						this.WriteErrorDetails(communicationException);
					}
					else
					{
						affinityGroups = null;
						return affinityGroups;
					}
				}
				return affinityGroups1;
			}
			return affinityGroups;
		}
Exemple #2
0
            }
            Console.WriteLine("Location Name:{0}", location.Name);
        }

        internal static void LogObject(HostedService hostedService)
        {
            if (hostedService == null)
                return;

            if (!string.IsNullOrEmpty(hostedService.ServiceName))
                Console.WriteLine("HostedService Name:{0}", hostedService.ServiceName);

            Console.WriteLine("HostedService Url:{0}", hostedService.Url.ToString());
            LogObject(hostedService.HostedServiceProperties);
            LogObject(hostedService.Deployments);
        }