private void LoadConfig() { XPathDocument document; XPathNavigator navigator; FileStream stream; XPathNodeIterator nodes; try { //stream = new FileStream(Path.Combine(applicationDirectory, "Config.xml"), FileMode.Open, FileAccess.Read); stream = new FileStream(Consts.Configuration, FileMode.Open, FileAccess.Read); } catch (FileNotFoundException) { Debugger.Error("The configuration XML file could not be found."); return; } document = new XPathDocument(stream); navigator = document.CreateNavigator(); nodes = navigator.Select("/config/startup"); if (nodes.MoveNext()) { navigator = nodes.Current; for (nodes = navigator.SelectChildren("module", navigator.NamespaceURI); nodes.MoveNext(); ) { navigator = nodes.Current; string name; name = navigator.GetAttribute("name", navigator.NamespaceURI); startupModules.Add(name); } } nodes = navigator.Select("/config/paths/directory"); if (nodes.MoveNext()) { navigator = nodes.Current; applicationDirectory = navigator.GetAttribute("path", navigator.NamespaceURI); } nodes = navigator.Select("/config/paths/modules"); if (nodes.MoveNext()) { navigator = nodes.Current; modulesDirectory = navigator.GetAttribute("path", navigator.NamespaceURI); } nodes = navigator.Select("/config/paths/temp"); if (nodes.MoveNext()) { navigator = nodes.Current; temporaryDirectory = navigator.GetAttribute("path", navigator.NamespaceURI); } nodes = navigator.Select("/config/strings/quit"); if (nodes.MoveNext()) { navigator = nodes.Current; defaultQuit = navigator.GetAttribute("message", navigator.NamespaceURI); } }