Exemple #1
0
        public string SystemXmlFilePath(string moduleID)
        {
            string       cultureConfig = BxSystemInfo.Instance.SystemPath.CultureConfigPath;
            string       relativePath  = null;
            BxModulePath temp          = BxSystemInfo.Instance.Regisries.GetModulePath(moduleID);

            if (temp != null)
            {
                relativePath = Path.Combine(@"Modules", temp.RelativePath);
            }
            else
            {
                relativePath = BxSystemInfo.Instance.Regisries.GetGeneralUIConfigRelativeDirectory(moduleID);
                if (!string.IsNullOrEmpty(relativePath))
                {
                    relativePath = Path.Combine("GeneralLayer", relativePath);
                }
            }
            if (string.IsNullOrEmpty(relativePath))
            {
                return(null);
            }

            string path = Path.Combine(cultureConfig, relativePath);

            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
            return(Path.Combine(path, @"DefaultUnits.xml"));
        }
Exemple #2
0
        string GetModulesUIConfigFilePath(string uiConfigID)
        {
            BxModulePath path = GetModulePath(uiConfigID);

            if (path != null)
            {
                return(Path.Combine(path.ConfigPath, "UIConfig.xml"));
            }
            return(null);
        }
Exemple #3
0
        public BxModulePath 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);

            BxModulePath mpath = new BxModulePath();

            mpath.RelativePath = relativePath;
            mpath.DllFilePath  = dllName;
            mpath.ConfigPath   = configPath;
            return(mpath);
        }