當前位置: 首頁>>代碼示例>>C#>>正文


C# Extensions.ExtensionConfigurationInput類代碼示例

本文整理匯總了C#中Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.ExtensionConfigurationInput的典型用法代碼示例。如果您正苦於以下問題:C# ExtensionConfigurationInput類的具體用法?C# ExtensionConfigurationInput怎麽用?C# ExtensionConfigurationInput使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExtensionConfigurationInput類屬於Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions命名空間,在下文中一共展示了ExtensionConfigurationInput類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ExecuteCommand

        public void ExecuteCommand()
        {
            InitializeAntimalwareSettings();
            ValidateParameters();

            RemoveAntimalwareExtension();
            RemoveExistingAntimalwareMonitoringConfig();

            ExtensionConfigurationInput[] extConfigInputs = null;
            if (AntimalwareExtensionConfigurationInput != null && AntimalwareMonitoringExtensionConfigurationInput != null)
            {
                extConfigInputs = new ExtensionConfigurationInput[2];
                extConfigInputs[0] = AntimalwareMonitoringExtensionConfigurationInput;
                extConfigInputs[1] = AntimalwareExtensionConfigurationInput;
            }
            else if (AntimalwareExtensionConfigurationInput != null)
            {
                extConfigInputs = new ExtensionConfigurationInput[1];
                extConfigInputs[0] = AntimalwareExtensionConfigurationInput;
            }
            else if (AntimalwareMonitoringExtensionConfigurationInput != null)
            {
                extConfigInputs = new ExtensionConfigurationInput[1];
                extConfigInputs[0] = AntimalwareMonitoringExtensionConfigurationInput;
            }

            // process any pending deployment changes
            if (extConfigInputs != null)
            {
                ExtensionConfiguration newExtConfig = ExtensionManager.Add(Deployment, extConfigInputs, Slot);
                ChangeDeployment(newExtConfig);
            }
        }
開發者ID:kangyangthu,項目名稱:azure-sdk-tools,代碼行數:33,代碼來源:RemoveAzureServiceAntimalwareExtension.cs

示例2: NewAzureDeploymentCmdletInfo

        public NewAzureDeploymentCmdletInfo(string serviceName, string packagePath, string configName, string slot,
            string label, string name, bool doNotStart, bool warning, ExtensionConfigurationInput config)
    {
        cmdletName = Utilities.NewAzureDeploymentCmdletName;

        cmdletParams.Add(new CmdletParam("ServiceName", serviceName));
        cmdletParams.Add(new CmdletParam("Package", packagePath));
        cmdletParams.Add(new CmdletParam("Configuration", configName));
        cmdletParams.Add(new CmdletParam("Slot", slot));

        if (label != null)
        {
            cmdletParams.Add(new CmdletParam("Label", label));
        }
        if (name != null)
        {
            cmdletParams.Add(new CmdletParam("Name", name));
        }
        if (doNotStart)
        {
            cmdletParams.Add(new CmdletParam("DoNotStart"));
        }
        if (warning)
        {
            cmdletParams.Add(new CmdletParam("TreatWarningsAsError"));
        }
        if (config != null)
        {
            cmdletParams.Add(new CmdletParam("ExtensionConfiguration", config));
        }
    }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:31,代碼來源:NewAzureDeploymentCmdletInfo.cs

示例3: SetAzureDeploymentConfigCmdletInfo

        public static SetAzureDeploymentCmdletInfo SetAzureDeploymentConfigCmdletInfo(string serviceName, string slot, string configPath, ExtensionConfigurationInput extConfig = null)
        {
            SetAzureDeploymentCmdletInfo result = new SetAzureDeploymentCmdletInfo(serviceName, slot);

            result.cmdletParams.Add(new CmdletParam("Config"));
            result.cmdletParams.Add(new CmdletParam("Configuration", configPath));

            if (extConfig != null)
            {
                result.cmdletParams.Add(new CmdletParam("ExtensionConfiguration", extConfig));
            }

            return result;
        }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:14,代碼來源:SetAzureDeploymentCmdletInfo.cs

示例4: InstallExtension

        public ExtensionConfiguration InstallExtension(ExtensionConfigurationInput context, string slot,
            DeploymentGetResponse deployment, DeploymentGetResponse peerDeployment)
        {
            Func<DeploymentGetResponse, ExtensionConfiguration> func = (d) => d == null ? null : d.ExtensionConfiguration;

            ExtensionConfiguration extConfig = func(deployment);
            ExtensionConfiguration secondSlotExtConfig = func(peerDeployment);

            return InstallExtension(context, slot, extConfig, secondSlotExtConfig);
        }
開發者ID:rturnage,項目名稱:azure-powershell,代碼行數:10,代碼來源:ExtensionManager.cs

示例5: AddNewAntimalwareMonitoringConfig

 private void AddNewAntimalwareMonitoringConfig()
 {
     // install diagnostics provider with a new antimalware event monitoring config
     InitializeDiagnosticsSettings();
     ExtensionConfigurationInput diagExtConfigInput = new ExtensionConfigurationInput
     {
         ProviderNameSpace = ProviderNamespace,
         Type = ExtensionName,
         CertificateThumbprint = CertificateThumbprint,
         ThumbprintAlgorithm = ThumbprintAlgorithm,
         X509Certificate = X509Certificate,
         PublicConfiguration = PublicConfiguration,
         PrivateConfiguration = PrivateConfiguration,
         Roles = new ExtensionRoleList(Role != null && Role.Any() ? Role.Select(r => new ExtensionRole(r)) : Enumerable.Repeat(new ExtensionRole(), 1))
     };
     AntimalwareMonitoringExtensionConfigurationInput = diagExtConfigInput;
 }
開發者ID:B-Rich,項目名稱:azure-sdk-tools,代碼行數:17,代碼來源:SetAzureServiceAntimalwareExtension.cs

示例6: ExecuteCommand

        public void ExecuteCommand()
        {
            ValidateParameters();

            // set diagnostics extension
            switch (monitoringAction)
            {
                case MonitoringActionType.Enable : EnableMonitoring(); break;
                case MonitoringActionType.Disable : RemoveExistingAntimalwareMonitoringConfig(); break;
                default: break;
            }

            // set antimalware extension 
            InitializeAntimalwareSettings();
            ExtensionConfigurationInput amExtConfigInput = new ExtensionConfigurationInput
            {
                ProviderNameSpace = ProviderNamespace,
                Type = ExtensionName,
                PublicConfiguration = PublicConfiguration,
                PrivateConfiguration = PrivateConfiguration,
                Roles = new ExtensionRoleList(Role != null && Role.Any() ? Role.Select(r => new ExtensionRole(r)) : Enumerable.Repeat(new ExtensionRole(), 1))
            };
            AntimalwareExtensionConfigurationInput = amExtConfigInput;

            ExtensionConfigurationInput[] extConfigInputs = null;
            if (AntimalwareExtensionConfigurationInput != null && AntimalwareMonitoringExtensionConfigurationInput != null)
            {
                extConfigInputs = new ExtensionConfigurationInput[2];
                extConfigInputs[0] = AntimalwareMonitoringExtensionConfigurationInput;
                extConfigInputs[1] = AntimalwareExtensionConfigurationInput;
            }
            else if (AntimalwareExtensionConfigurationInput != null)
            {
                extConfigInputs = new ExtensionConfigurationInput[1];
                extConfigInputs[0] = AntimalwareExtensionConfigurationInput;
            }
            else if (AntimalwareMonitoringExtensionConfigurationInput!=null)
            {
                extConfigInputs = new ExtensionConfigurationInput[1];
                extConfigInputs[0] = AntimalwareMonitoringExtensionConfigurationInput;
            }

            // process any pending deployment changes
            if (extConfigInputs != null)
            {
                ExtensionConfiguration newExtConfig = ExtensionManager.Add(Deployment, extConfigInputs, Slot);
                ChangeDeployment(newExtConfig);
            }
        }
開發者ID:B-Rich,項目名稱:azure-sdk-tools,代碼行數:49,代碼來源:SetAzureServiceAntimalwareExtension.cs

示例7: ExecuteCommand

        public void ExecuteCommand()
        {
            ValidateParameters();
            ExtensionConfigurationInput context = new ExtensionConfigurationInput
            {
                Version = Version,
                ProviderNameSpace = ProviderNamespace,
                Type = ExtensionName,
                CertificateThumbprint = CertificateThumbprint,
                ThumbprintAlgorithm = ThumbprintAlgorithm,
                X509Certificate = X509Certificate,
                PublicConfiguration = PublicConfiguration,
                PrivateConfiguration = PrivateConfiguration,
                Roles = new ExtensionRoleList(Role != null && Role.Any() ? Role.Select(r => new ExtensionRole(r)) : Enumerable.Repeat(new ExtensionRole(), 1))
            };

            var secondSlotDeployment = GetDeployment(this.Slot == DeploymentSlotType.Production ? DeploymentSlotType.Staging : DeploymentSlotType.Production);
            Microsoft.WindowsAzure.Management.Compute.Models.ExtensionConfiguration secondSlotExtensionConfiguration = 
                secondSlotDeployment != null ? secondSlotDeployment.ExtensionConfiguration : null;

            var extConfig = ExtensionManager.InstallExtension(context, Slot, Deployment.ExtensionConfiguration, secondSlotExtensionConfiguration);
            ChangeDeployment(extConfig);
        }
開發者ID:ldattilo,項目名稱:azure-powershell,代碼行數:23,代碼來源:SetAzureServiceDiagnosticsExtension.cs

示例8: Add

 public ExtensionConfigurationBuilder Add(ExtensionConfigurationInput context, string extensionId)
 {
     if (context != null && context.Roles != null)
     {
         context.Roles.ForEach(r => Add(r, extensionId));
     }
     return this;
 }
開發者ID:NordPool,項目名稱:azure-sdk-tools,代碼行數:8,代碼來源:ExtensionConfigurationBuilder.cs

示例9: VerifyExtensionConfigRDP

        private bool VerifyExtensionConfigRDP(ExtensionConfigurationInput resultConfig, string user, string pass, List<string> roles, DateTime exp, string thumbprint = null, string algorithm = null, X509Certificate2 cert = null)
        {
            try
            {
                string resultUserName = GetInnerText(resultConfig.PublicConfiguration, "UserName");
                string resultPassword = GetInnerText(resultConfig.PrivateConfiguration, "Password");
                string resultExpDate = GetInnerText(resultConfig.PublicConfiguration, "Expiration");

                Console.WriteLine("Type: {0}, UserName:{1}, Password: {2}, ExpirationDate: {3}, CertificateThumbprint: {4}, ThumbprintAlgorithm: {5}, X509Certificate: {6}",
                    resultConfig.Type, resultUserName, resultPassword, resultExpDate, resultConfig.CertificateThumbprint, resultConfig.ThumbprintAlgorithm, resultConfig.X509Certificate);

                Assert.AreEqual(resultConfig.Type, "RDP", "Type is not equal!");
                Assert.AreEqual(resultUserName, user);
                Assert.AreEqual(resultPassword, pass);
                Assert.IsTrue(Utilities.CompareDateTime(exp, resultExpDate));

                if (string.IsNullOrWhiteSpace(thumbprint))
                {
                    Assert.IsTrue(string.IsNullOrWhiteSpace(resultConfig.CertificateThumbprint));
                }
                else
                {
                    Assert.AreEqual(resultConfig.CertificateThumbprint, thumbprint, "Certificate thumbprint is not equal!");
                }

                if (string.IsNullOrWhiteSpace(algorithm))
                {
                    Assert.IsTrue(string.IsNullOrWhiteSpace(resultConfig.ThumbprintAlgorithm));
                }
                else
                {
                    Assert.AreEqual(resultConfig.ThumbprintAlgorithm, algorithm, "Thumbprint algorithm is not equal!");
                }
                Assert.AreEqual(resultConfig.X509Certificate, cert, "X509Certificate is not equal!");
                if (resultConfig.Roles.Count == 1 && string.IsNullOrEmpty(resultConfig.Roles[0].RoleName))
                {
                    Assert.IsTrue(roles.Contains(resultConfig.Roles[0].RoleType.ToString()));
                }
                else
                {
                    foreach (ExtensionRole role in resultConfig.Roles)
                    {
                        Assert.IsTrue(roles.Contains(role.RoleName));
                    }
                }

                return true;
            }
            catch
            {
                return false;
            }
        }
開發者ID:khoatle,項目名稱:azure-powershell,代碼行數:53,代碼來源:FunctionalTest.cs

示例10: VerifyExtensionConfigDiag

        private bool VerifyExtensionConfigDiag(ExtensionConfigurationInput resultConfig, string storage, List<string> roles, XmlDocument wadconfig = null, string thumbprint = null, string algorithm = null, X509Certificate2 cert = null)
        {
            try
            {
                string resultStorageAccount = GetInnerText(resultConfig.PublicConfiguration, "StorageAccount");
                string resultWadCfg = Utilities.GetInnerXml(resultConfig.PublicConfiguration, "WadCfg");
                if (string.IsNullOrWhiteSpace(resultWadCfg))
                {
                    resultWadCfg = null;
                }
                string resultStorageKey = GetInnerValue(resultConfig.PrivateConfiguration, "StorageAccount", "key");

                Console.WriteLine("Type: {0}, StorageAccountName:{1}, StorageKey: {2}, WadCfg: {3}, CertificateThumbprint: {4}, ThumbprintAlgorithm: {5}, X509Certificate: {6}",
                    resultConfig.Type, resultStorageAccount, resultStorageKey, resultWadCfg, resultConfig.CertificateThumbprint, resultConfig.ThumbprintAlgorithm, resultConfig.X509Certificate);

                Assert.AreEqual("PaaSDiagnostics", resultConfig.Type, "Type is not equal!");
                Assert.AreEqual(storage, resultStorageAccount);
                Assert.IsTrue(Utilities.CompareWadCfg(resultWadCfg, wadconfig));

                if (string.IsNullOrWhiteSpace(thumbprint))
                {
                    Assert.IsTrue(string.IsNullOrWhiteSpace(resultConfig.CertificateThumbprint));
                }
                else
                {
                    Assert.AreEqual(thumbprint, resultConfig.CertificateThumbprint, "Certificate thumbprint is not equal!");
                }
                if (string.IsNullOrWhiteSpace(algorithm))
                {
                    Assert.IsTrue(string.IsNullOrWhiteSpace(resultConfig.ThumbprintAlgorithm));
                }
                else
                {
                    Assert.AreEqual(algorithm, resultConfig.ThumbprintAlgorithm, "Thumbprint algorithm is not equal!");
                }
                Assert.AreEqual(cert, resultConfig.X509Certificate, "X509Certificate is not equal!");
                if (resultConfig.Roles.Count == 1 && string.IsNullOrEmpty(resultConfig.Roles[0].RoleName))
                {
                    Assert.IsTrue(roles.Contains(resultConfig.Roles[0].RoleType.ToString()));
                }
                else
                {
                    foreach (ExtensionRole role in resultConfig.Roles)
                    {
                        Assert.IsTrue(roles.Contains(role.RoleName));
                    }
                }

                return true;
            }
            catch
            {
                return false;
            }
        }
開發者ID:khoatle,項目名稱:azure-powershell,代碼行數:55,代碼來源:FunctionalTest.cs

示例11: PostProcessExtensionConfigAfterInstallExtension

        /// <summary>
        /// The configuration must be defined in either allRoles or namedRoles.
        /// Otherwise, it will fail for trying to apply the same extension.
        /// We only apply the fix here but not in ExtensionManager, so other commands won't get affected.
        /// </summary>
        /// <param name="configInput">The configuration used for InstallExtension()</param>
        /// <param name="extConfig">The extension config after InstallExtension()</param>
        private Microsoft.WindowsAzure.Management.Compute.Models.ExtensionConfiguration PostProcessExtensionConfigAfterInstallExtension(
            ExtensionConfigurationInput configInput,
            Microsoft.WindowsAzure.Management.Compute.Models.ExtensionConfiguration extConfig)
        {
            ExtensionConfigurationBuilder builder = ExtensionManager.GetBuilder(extConfig);
            if (configInput.Roles.All(r => r.Default))
            {
                // If the configuration applies to all roles, remove the ones defined in each named roles
                foreach (var role in Deployment.Roles)
                {
                    builder.Remove(role.RoleName, ProviderNamespace, ExtensionName);
                }
            }
            else
            {
                // If the configuration applies to some specific roles and there is already extension defined in allRoles,
                // we remove the setting from allRoles and move it to specific namedRoles.
                if (builder.ExistDefault(ProviderNamespace, ExtensionName))
                {
                    var diagnosticExtensionId = extConfig.AllRoles.FirstOrDefault(ext =>
                    {
                        var e = ExtensionManager.GetExtension(ext.Id);
                        return e != null && e.ProviderNamespace == ProviderNamespace && e.Type == ExtensionName;
                    }).Id;
                    builder.RemoveDefault(diagnosticExtensionId);

                    foreach (var role in Deployment.Roles)
                    {
                        // The role is previously configured by allRoles, move it to the namedRole itself
                        if (!configInput.Roles.Exists(r => r.RoleName == role.RoleName))
                        {
                            builder.Add(role.RoleName, diagnosticExtensionId);
                        }
                    }
                }
            }

            return builder.ToConfiguration();
        }
開發者ID:rturnage,項目名稱:azure-powershell,代碼行數:46,代碼來源:SetAzureServiceDiagnosticsExtension.cs

示例12: RemoveExistingAntimalwareMonitoringConfig

        protected void RemoveExistingAntimalwareMonitoringConfig()
        {
            // this does not remove the diagnostics extension entirely, it only removes the portion of the 
            // diagnostics configuration that monitors antimalware events- everything else will remain 
            // in order to avoid doing harm to any other users who may be sharing the diagnostics extension 

            var ext = GetDiagnosticsExtension();
            if (ext != null)
            {
                string tmpXmlString = ext.PublicConfiguration;
                string AntimalwareDataSourceName = "System!*[System[Provider[@Name='Microsoft Antimalware']]]";
                string DiagnosticsConfigXmlNamespace = @"http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration";

                // remove the data source element with the antimalware event provider 
                XmlDocument tmpXmlDoc = new XmlDocument();
                tmpXmlDoc.LoadXml(tmpXmlString);

                // retrieve storage account name from public configuration
                string stgAcctNameXPath = string.Format(@"//*[local-name()='{0}' and namespace-uri()='{1}']", StorageAccountElemStr, DiagnosticsConfigXmlNamespace);
                XmlNode stgAcctNameNode = tmpXmlDoc.DocumentElement.SelectSingleNode(stgAcctNameXPath);
                if (stgAcctNameNode != null)
                {
                    StorageAccountName = stgAcctNameNode.InnerText;
                }
                if (string.IsNullOrWhiteSpace(StorageAccountName))
                {
                    // do not modify diagnostics config without including the storage account
                    // throw terminating exception since it is not possible to preserve the 
                    // existing storage account with the configuration if it doesn't have a  
                    // hint to what the last storage account was in the public configuration 
                    ThrowTerminatingError(new ErrorRecord(
                        new Exception(Resources.ServiceExtensionCannotFindStorageAccountName),
                        string.Empty,
                        ErrorCategory.InvalidData,
                        null));

                    return;
                }
                else
                {
                    // check the storage account and initialize for use
                    ValidateStorageAccount();
                }

                // locate the antimalware data source node in the document 
                string antimalwareDataSourceXPath = string.Format(@"//*[local-name()='{0}' and @name=""{1}"" and namespace-uri()='{2}']", "DataSource", AntimalwareDataSourceName, DiagnosticsConfigXmlNamespace);
                XmlNode antimalwareDataSourceNode = tmpXmlDoc.DocumentElement.SelectSingleNode(antimalwareDataSourceXPath);
                if (antimalwareDataSourceNode != null)
                {
                    XmlNode windowsEventLogNode = antimalwareDataSourceNode.ParentNode;
                    if (windowsEventLogNode.RemoveChild(antimalwareDataSourceNode) != null)
                    {
                        // remove the windows event log if there are no other child data sources present
                        // as will be required for schema validation to succeed when sending the new config
                        // any other data sources outside of the windows event log are left untouched 
                        if (!windowsEventLogNode.HasChildNodes)
                        {
                            windowsEventLogNode.ParentNode.RemoveChild(windowsEventLogNode);
                        }
                    }

                    // now reinstall the diagnostics extension with the updated configuration
                    InitializeDiagnosticsSettings();
                    ExtensionConfigurationInput diagExtConfigInput = new ExtensionConfigurationInput
                    {
                        ProviderNameSpace = ProviderNamespace,
                        Type = ExtensionName,
                        CertificateThumbprint = CertificateThumbprint,
                        ThumbprintAlgorithm = ThumbprintAlgorithm,
                        X509Certificate = X509Certificate,
                        PublicConfiguration = tmpXmlDoc.OuterXml,
                        PrivateConfiguration = PrivateConfiguration,
                        Roles = new ExtensionRoleList(Role != null && Role.Any() ? Role.Select(r => new ExtensionRole(r)) : Enumerable.Repeat(new ExtensionRole(), 1))
                    };
                    AntimalwareMonitoringExtensionConfigurationInput = diagExtConfigInput;
                }
                else
                {
                    // no existing antimalware data source was found needing removal
                    return;
                }
            }
        }
開發者ID:B-Rich,項目名稱:azure-sdk-tools,代碼行數:83,代碼來源:BaseAzureServiceAntimalwareExtension.cs

示例13: NewAzureDeployment

        private void NewAzureDeployment(ExtensionConfigurationInput domainJoinExtensionConfig = null)
        {
            //Create a new Azure Iaas VM and set Domain Join extension, get domain join extension and then remove domain join extension
            Console.WriteLine("Creating a new Azure Iaas VM");

            vmPowershellCmdlets.NewAzureService(_serviceName, _serviceName, null, AffinityGroupName);

            Console.WriteLine("Service, {0}, is created.", _serviceName);

            vmPowershellCmdlets.AddAzureCertificate(_serviceName, _rdpCertPath.FullName, password);

            if (domainJoinExtensionConfig == null)
            {
                vmPowershellCmdlets.NewAzureDeployment(_serviceName, _packagePath1.FullName, _configPath1.FullName, DeploymentSlotType.Production, _deploymentLabel, _deploymentName, false, false);
                Console.WriteLine("New deployment created successfully.");
            }
            else
            {
                vmPowershellCmdlets.NewAzureDeployment(_serviceName, _packagePath1.FullName, _configPath1.FullName, DeploymentSlotType.Production, _deploymentLabel, _deploymentName, false, false, domainJoinExtensionConfig);
                Console.WriteLine("{0}:New deployment {1} with domain join {2} created successfully.", DateTime.Now, _serviceName, domainJoinExtensionConfig.Type);
            }
        }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:22,代碼來源:AzureServiceADDomainJoinExtensionTests.cs

示例14: Set

        public ExtensionConfiguration Set(DeploymentGetResponse currentDeployment, DeploymentGetResponse peerDeployment, ExtensionConfigurationInput[] inputs, string slot)
        {
            string errorConfigInput = null;
            if (!Validate(inputs, out errorConfigInput))
            {
                throw new Exception(string.Format(Resources.ServiceExtensionCannotApplyExtensionsInSameType, errorConfigInput));
            }

            ExtensionConfigurationBuilder configBuilder = this.GetBuilder();
            foreach (ExtensionConfigurationInput context in inputs)
            {
                if (context != null)
                {
                    ExtensionConfiguration currentConfig = this.InstallExtension(context, slot, currentDeployment, peerDeployment);

                    foreach (var r in currentConfig.AllRoles)
                    {
                        if (currentDeployment == null || !this.GetBuilder(currentDeployment.ExtensionConfiguration).ExistAny(r.Id))
                        {
                            configBuilder.AddDefault(r.Id);
                        }
                    }
                    foreach (var r in currentConfig.NamedRoles)
                    {
                        foreach (var e in r.Extensions)
                        {
                            if (currentDeployment == null || !this.GetBuilder(currentDeployment.ExtensionConfiguration).ExistAny(e.Id))
                            {
                                configBuilder.Add(r.RoleName, e.Id);
                            }
                        }
                    }
                }
            }

            var extConfig = configBuilder.ToConfiguration();

            return extConfig;
        }
開發者ID:rturnage,項目名稱:azure-powershell,代碼行數:39,代碼來源:ExtensionManager.cs

示例15: Validate

        public static bool Validate(ExtensionConfigurationInput[] inputs, out string errorConfigInput)
        {
            var roleList = (from c in inputs
                            where c != null
                            from r in c.Roles
                            select r).GroupBy(r => r.ToString()).Select(g => g.First());

            foreach (var role in roleList)
            {
                var result = from c in inputs
                             where c != null && c.Roles.Any(r => r.ToString() == role.ToString())
                             select string.Format("{0}.{1}", c.ProviderNameSpace, c.Type);
                foreach (var s in result)
                {
                    if (result.Count(t => t == s) > 1)
                    {
                        errorConfigInput = s;
                        return false;
                    }
                }
            }

            errorConfigInput = null;
            return true;
        }
開發者ID:rturnage,項目名稱:azure-powershell,代碼行數:25,代碼來源:ExtensionManager.cs


注:本文中的Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.ExtensionConfigurationInput類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。