private void init_driver() { drivers.Clear(); var xml = new XmlDocument(); using (var stream = ResourcesHelper.ReadResources <DBDriverProvice>("Setting.driver.xml")) { xml.Load(stream); } var root = xml.SelectSingleNode("/Drivers"); if (root.HasChildNodes) { foreach (XmlNode item in root.ChildNodes) { if (item != null && item.HasChildNodes) { DBDriver driver = new DBDriver(); foreach (XmlNode children in item.ChildNodes) { if (children.Name == "ConnectionString") { driver.ConnectionString = children.InnerText; } else if (children.Name == "Description") { driver.Description = children.InnerText; } } drivers.Add(driver); } } } }
private void init_driver() { drivers.Clear(); var xml = new XmlDocument(); using (var stream = ResourcesHelper.ReadResources<DBDriverProvice>("Setting.driver.xml")) { xml.Load(stream); } var root = xml.SelectSingleNode("/Drivers"); if (root.HasChildNodes) { foreach (XmlNode item in root.ChildNodes) { if (item != null && item.HasChildNodes) { DBDriver driver = new DBDriver(); foreach (XmlNode children in item.ChildNodes) { if (children.Name == "ConnectionString") { driver.ConnectionString = children.InnerText; } else if (children.Name == "Description") { driver.Description = children.InnerText; } } drivers.Add(driver); } } } }