/// <summary> /// Get the XML-element for the connection string. /// </summary> /// <param name="connectionString">The connection string with its parameters.</param> /// <returns>The element for XML.</returns> private XElement GetConnectionStringElement(ConnectionStringEntity connectionString) { XElement connectionStringElement = new XElement("ConnectionString"); connectionStringElement.SetAttributeValue("Key", connectionString.Key); connectionStringElement.SetAttributeValue("Value", connectionString.ConnectionString); return(connectionStringElement); }
/// <summary> /// Craete a basic XML-file. /// </summary> private void CreateBasicXmlFile() { ConnectionStringEntity connectionString = new ConnectionStringEntity(DefaultConnectionStringValue); XElement xml = new XElement("ConnectionStrings", GetConnectionStringElement(connectionString)); _xmlDocument.Add(xml); _xmlDocument.Save(_filename); }