public static TestConfigurations ReadFromXml(XElement testConfigurationsElement)
        {
            TestConfigurations result = new TestConfigurations();
            result.TargetTenantName = (string)testConfigurationsElement.Element("TargetTestTenant");

            List<TenantConfiguration> tenantConfigurationList = new List<TenantConfiguration>();
            foreach (XElement tenantConfigurationElement in testConfigurationsElement.Element("TenantConfigurations").Elements("TenantConfiguration"))
            {
                TenantConfiguration config = new TenantConfiguration();
                config.TenantName = (string)tenantConfigurationElement.Element("TenantName");
                config.AccountName = (string)tenantConfigurationElement.Element("AccountName");
                config.AccountKey = (string)tenantConfigurationElement.Element("AccountKey");
                config.BlobServiceEndpoint = (string)tenantConfigurationElement.Element("BlobServiceEndpoint");
                config.QueueServiceEndpoint = (string)tenantConfigurationElement.Element("QueueServiceEndpoint");
                config.TableServiceEndpoint = (string)tenantConfigurationElement.Element("TableServiceEndpoint");
                config.BlobServiceSecondaryEndpoint = (string)tenantConfigurationElement.Element("BlobServiceSecondaryEndpoint");
                config.QueueServiceSecondaryEndpoint = (string)tenantConfigurationElement.Element("QueueServiceSecondaryEndpoint");
                config.TableServiceSecondaryEndpoint = (string)tenantConfigurationElement.Element("TableServiceSecondaryEndpoint");
                config.TenantType = (TenantType)Enum.Parse(typeof(TenantType), (string)tenantConfigurationElement.Element("TenantType"), true);
                tenantConfigurationList.Add(config);
            }

            result.TenantConfigurations = tenantConfigurationList;
            return result;
        }
Ejemplo n.º 2
0
        public static TestConfigurations ReadFromXml(XElement testConfigurationsElement)
        {
            TestConfigurations result = new TestConfigurations();

            result.TargetTenantName = (string)testConfigurationsElement.Element("TargetTestTenant");

            List <TenantConfiguration> tenantConfigurationList = new List <TenantConfiguration>();

            foreach (XElement tenantConfigurationElement in testConfigurationsElement.Element("TenantConfigurations").Elements("TenantConfiguration"))
            {
                TenantConfiguration config = new TenantConfiguration();
                config.TenantName                    = (string)tenantConfigurationElement.Element("TenantName");
                config.AccountName                   = (string)tenantConfigurationElement.Element("AccountName");
                config.AccountKey                    = (string)tenantConfigurationElement.Element("AccountKey");
                config.BlobServiceEndpoint           = (string)tenantConfigurationElement.Element("BlobServiceEndpoint");
                config.FileServiceEndpoint           = (string)tenantConfigurationElement.Element("FileServiceEndpoint");
                config.QueueServiceEndpoint          = (string)tenantConfigurationElement.Element("QueueServiceEndpoint");
                config.TableServiceEndpoint          = (string)tenantConfigurationElement.Element("TableServiceEndpoint");
                config.BlobServiceSecondaryEndpoint  = (string)tenantConfigurationElement.Element("BlobServiceSecondaryEndpoint");
                config.QueueServiceSecondaryEndpoint = (string)tenantConfigurationElement.Element("QueueServiceSecondaryEndpoint");
                config.TableServiceSecondaryEndpoint = (string)tenantConfigurationElement.Element("TableServiceSecondaryEndpoint");
                config.TenantType                    = (TenantType)Enum.Parse(typeof(TenantType), (string)tenantConfigurationElement.Element("TenantType"), true);
                tenantConfigurationList.Add(config);
            }

            result.TenantConfigurations = tenantConfigurationList;
            return(result);
        }