当前位置: 首页>>代码示例>>C#>>正文


C# AzureEnvironment.GetEndpoint方法代码示例

本文整理汇总了C#中Microsoft.Azure.Common.Authentication.Models.AzureEnvironment.GetEndpoint方法的典型用法代码示例。如果您正苦于以下问题:C# AzureEnvironment.GetEndpoint方法的具体用法?C# AzureEnvironment.GetEndpoint怎么用?C# AzureEnvironment.GetEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Azure.Common.Authentication.Models.AzureEnvironment的用法示例。


在下文中一共展示了AzureEnvironment.GetEndpoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MergeEnvironmentProperties

        private AzureEnvironment MergeEnvironmentProperties(AzureEnvironment environment1, AzureEnvironment environment2)
        {
            if (environment1 == null || environment2 == null)
            {
                throw new ArgumentNullException("environment1");
            }
            if (!string.Equals(environment1.Name, environment2.Name, StringComparison.InvariantCultureIgnoreCase))
            {
                throw new ArgumentException("Environment names do not match.");
            }
            AzureEnvironment mergedEnvironment = new AzureEnvironment
            {
                Name = environment1.Name
            };

            // Merge all properties
            foreach (AzureEnvironment.Endpoint property in Enum.GetValues(typeof(AzureEnvironment.Endpoint)))
            {
                string propertyValue = environment1.GetEndpoint(property) ?? environment2.GetEndpoint(property);
                if (propertyValue != null)
                {
                    mergedEnvironment.Endpoints[property] = propertyValue;
                }
            }

            return mergedEnvironment;
        }
开发者ID:injyzarif,项目名称:azure-powershell,代码行数:27,代码来源:RMProfileClient.cs

示例2: ExecuteCmdlet

 public override void ExecuteCmdlet()
 {
     var newEnvironment = new AzureEnvironment
     {
         Name = Name,
         OnPremise = EnableADFSAuthentication
     };
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl] = PublishSettingsFileUrl;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.ServiceManagement] = ServiceEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.ResourceManager] = ResourceManagerEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.ManagementPortalUrl] = ManagementPortalUrl;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.StorageEndpointSuffix] = StorageEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectory] = ActiveDirectoryEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId] = ActiveDirectoryServiceEndpointResourceId;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.Gallery] = GalleryEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.Graph] = GraphEndpoint;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix] = AzureKeyVaultDnsSuffix;
     newEnvironment.Endpoints[AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId] = AzureKeyVaultServiceEndpointResourceId;
     
     ProfileClient.AddOrSetEnvironment(newEnvironment);
     List<object> args = new List<object> { "Name", newEnvironment.Name };
     foreach (AzureEnvironment.Endpoint property in Enum.GetValues(typeof(AzureEnvironment.Endpoint)))
     {
         args.AddRange(new object[] { property, newEnvironment.GetEndpoint(property) });
     }
     WriteObject(base.ConstructPSObject(null, args.ToArray()));
 }
开发者ID:shuainie,项目名称:azure-powershell,代码行数:27,代码来源:AddAzureEnvironment.cs


注:本文中的Microsoft.Azure.Common.Authentication.Models.AzureEnvironment.GetEndpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。