Exemple #1
0
 public static RoleConfiguration Load(XElement element)
 {
     var rc = new RoleConfiguration();
     rc.RoleName = (string)element.Attribute("name");
     rc.InstanceCount = (int)element.Elements(XmlNamespaces.ServiceConfig + "Instances").Single().Attribute("count");
     rc.ConfigurationSettings = element.Elements(XmlNamespaces.ServiceConfig + "ConfigurationSettings").SelectMany(d => d.Elements()).ToDictionary(x => (string)x.Attribute("name"), x => (string)x.Attribute("value"));
     rc.Certificates = element.Elements(XmlNamespaces.ServiceConfig + "Certificates").SelectMany(d => d.Elements()).ToDictionary(x => (string)x.Attribute("name"), x => new CertificateConfig(x));
     return rc;
 }
Exemple #2
0
        public static RoleConfiguration Load(XElement element)
        {
            var rc = new RoleConfiguration();

            rc.RoleName              = (string)element.Attribute("name");
            rc.InstanceCount         = (int)element.Elements(XmlNamespaces.ServiceConfig + "Instances").Single().Attribute("count");
            rc.ConfigurationSettings = element.Elements(XmlNamespaces.ServiceConfig + "ConfigurationSettings").SelectMany(d => d.Elements()).ToDictionary(x => (string)x.Attribute("name"), x => (string)x.Attribute("value"));
            rc.Certificates          = element.Elements(XmlNamespaces.ServiceConfig + "Certificates").SelectMany(d => d.Elements()).ToDictionary(x => (string)x.Attribute("name"), x => new CertificateConfig(x));
            return(rc);
        }