public ServicesConfiguration() { XElement file = XElement.Load(Configuration.GetPath("Services.xml")); AuthenticationEnabled = file.Element("users").Attribute("authenticationEnabled").Value == "true"; BonjourEnabled = file.Element("bonjour").Element("enabled").Value == "true"; BonjourName = file.Element("bonjour").Element("pcname").Value; Port = Int32.Parse(file.Element("port").Value); EnableIPv6 = file.Element("enableIPv6").Value == "true"; MASConnection = file.Element("connections").Element("mas").Value; TASConnection = file.Element("connections").Element("tas").Value; NetworkImpersonation = new NetworkImpersonationConfiguration() { Domain = file.Element("networkImpersonation").Element("domain").Value, Username = file.Element("networkImpersonation").Element("username").Value, EncryptedPassword = file.Element("networkImpersonation").Element("password").Value, ReadInStreamingService = file.Element("networkImpersonation").Element("readInStreamingService").Value == "true" }; Users = file.Element("users").Elements("user").Select(x => new User() { Username = x.Element("username").Value, EncryptedPassword = x.Element("password").Value }).ToList(); }