public RoleConfiguration(XElement data) { this.ns = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration"; this.Name = data.Attribute("name").Value; this.InstanceCount = int.Parse(data.Element(this.ns + "Instances").Attribute("count").Value, CultureInfo.InvariantCulture); this.Settings = new Dictionary <string, string>(); if (data.Element(this.ns + "ConfigurationSettings") != null) { foreach (XElement xElement in data.Element(this.ns + "ConfigurationSettings").Descendants()) { this.Settings.Add(xElement.Attribute("name").Value, xElement.Attribute("value").Value); } } this.Certificates = new Dictionary <string, CertificateConfiguration>(); if (data.Element(this.ns + "Certificates") != null) { foreach (XElement xElement1 in data.Element(this.ns + "Certificates").Descendants()) { CertificateConfiguration certificateConfiguration = new CertificateConfiguration(); certificateConfiguration.Thumbprint = xElement1.Attribute("thumbprint").Value; certificateConfiguration.ThumbprintAlgorithm = xElement1.Attribute("thumbprintAlgorithm").Value; CertificateConfiguration certificateConfiguration1 = certificateConfiguration; this.Certificates.Add(xElement1.Attribute("name").Value, certificateConfiguration1); } } }
public RoleConfiguration(XElement data) { this.ns = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration"; this.Name = data.Attribute("name").Value; this.InstanceCount = int.Parse(data.Element(this.ns + "Instances").Attribute("count").Value, CultureInfo.InvariantCulture); this.Settings = new Dictionary<string, string>(); if (data.Element(this.ns + "ConfigurationSettings") != null) { foreach (XElement xElement in data.Element(this.ns + "ConfigurationSettings").Descendants()) { this.Settings.Add(xElement.Attribute("name").Value, xElement.Attribute("value").Value); } } this.Certificates = new Dictionary<string, CertificateConfiguration>(); if (data.Element(this.ns + "Certificates") != null) { foreach (XElement xElement1 in data.Element(this.ns + "Certificates").Descendants()) { CertificateConfiguration certificateConfiguration = new CertificateConfiguration(); certificateConfiguration.Thumbprint = xElement1.Attribute("thumbprint").Value; certificateConfiguration.ThumbprintAlgorithm = xElement1.Attribute("thumbprintAlgorithm").Value; CertificateConfiguration certificateConfiguration1 = certificateConfiguration; this.Certificates.Add(xElement1.Attribute("name").Value, certificateConfiguration1); } } }
public RoleConfiguration(XElement data) { this.Name = data.Attribute("name").Value; this.InstanceCount = int.Parse(data.Element(this.ns + "Instances").Attribute("count").Value, CultureInfo.InvariantCulture); this.Settings = new Dictionary <string, string>(); if (data.Element(this.ns + "ConfigurationSettings") != null) { foreach (var setting in data.Element(this.ns + "ConfigurationSettings").Descendants()) { this.Settings.Add(setting.Attribute("name").Value, setting.Attribute("value").Value); } } this.Certificates = new Dictionary <string, CertificateConfiguration>(); if (data.Element(this.ns + "Certificates") != null) { foreach (var setting in data.Element(this.ns + "Certificates").Descendants()) { var certificate = new CertificateConfiguration { Thumbprint = setting.Attribute("thumbprint").Value, ThumbprintAlgorithm = setting.Attribute("thumbprintAlgorithm").Value }; this.Certificates.Add(setting.Attribute("name").Value, certificate); } } }
public RoleConfiguration(XElement data) { this.Name = data.Attribute("name").Value; this.InstanceCount = int.Parse(data.Element(this.ns + "Instances").Attribute("count").Value, CultureInfo.InvariantCulture); this.Settings = new Dictionary<string, string>(); if (data.Element(this.ns + "ConfigurationSettings") != null) { foreach (var setting in data.Element(this.ns + "ConfigurationSettings").Descendants()) { this.Settings.Add(setting.Attribute("name").Value, setting.Attribute("value").Value); } } this.Certificates = new Dictionary<string, CertificateConfiguration>(); if (data.Element(this.ns + "Certificates") != null) { foreach (var setting in data.Element(this.ns + "Certificates").Descendants()) { var certificate = new CertificateConfiguration { Thumbprint = setting.Attribute("thumbprint").Value, ThumbprintAlgorithm = setting.Attribute("thumbprintAlgorithm").Value }; this.Certificates.Add(setting.Attribute("name").Value, certificate); } } }