string GetModulesUIConfigFilePath(string uiConfigID) { HeModulePath path = GetModulePath(uiConfigID); if (path != null) { return(Path.Combine(path.ConfigPath, "UIConfig.xml")); } return(null); }
public HeModulePath GetModulePath(string id) { string modulesInfoFilePath = Path.Combine(_registriesPath, @"ModulesInfo.xml"); XmlDocument doc = new XmlDocument(); try { doc.Load(modulesInfoFilePath); } catch (System.Exception) { //MessageBox.Show("Can not open file " + modulesInfoFilePath + "!\n"); return(null); } XmlElement root = doc.DocumentElement; XmlElement fmNode = root.SelectSingleNode("FunctionModules") as XmlElement; string xPath = string.Format("//Module[@id='{0}']", id); XmlElement moduleNode = fmNode.SelectSingleNode(xPath) as XmlElement; if (moduleNode == null) { //MessageBox.Show("Can not find module " + id + " in file ModulesInfo.xml !\n"); return(null); } string relativePath = moduleNode.GetAttribute("relativePath"); string dllName = moduleNode.GetAttribute("dll"); dllName = Path.Combine(_modulesDllPath, relativePath, dllName); string configPath = Path.Combine(_modulesConfigPath, relativePath); HeModulePath mpath = new HeModulePath(); mpath.RelativePath = relativePath; mpath.DllFilePath = dllName; mpath.ConfigPath = configPath; return(mpath); }