Пример #1
0
        public static CustomScriptConfig ReadConfig(string fileName)
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "Script", fileName);

            return(XmlUtil.ReadFromFile <CustomScriptConfig>(fpath));
        }
Пример #2
0
        public static T PlugGet<T>(this string name)
        {
          //  name = 
            if (name.ToUpper().IndexOf(".XML") > 0)
            {
                name = name.ToUpper();
               
                
                if (name.IndexOf("@") >= 0)
                {
                    name = name.Replace(".XML", "");
                    string[] arr = name.Split('@');
                    string xml = arr[0];
                    AtawAppContext.Current.PageFlyweight.PageItems["XmlString"] = arr[1];
                    name = xml + ".XML";
                }

                string path = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH, name);
                object obj = XmlUtil.ReadFromFile(path, typeof(T));
                return (T)obj;
            }
            else
            {
                return name.CodePlugIn<T>();
            }
        }
Пример #3
0
        private DataFormConfig ReadConfig(string fileName)
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "form", fileName);

            return(XmlUtil.ReadFromFile <DataFormConfig>(fpath));
        }
Пример #4
0
        public static DbCodeTableXml ReadConfig(string fileName)
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "CodeTable", fileName);

            return(XmlUtil.ReadFromFile <DbCodeTableXml>(fpath));
        }
Пример #5
0
        public static FileManagementConfig ReadConfig(string binPath)
        {
            string fpath   = Path.Combine(binPath, AtawApplicationConfig.REAL_PATH, "FileManagementConfig.xml");
            var    _config = XmlUtil.ReadFromFile <FileManagementConfig>(fpath);

            return(MergeFileManagementConfig(_config));
        }
Пример #6
0
        public static IList <DbCodeTableXml> ReadConfigFromDir()
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "CodeTable");

            string[] codeTableXmls = Directory.GetFiles(fpath, "*.xml", SearchOption.AllDirectories);
            IList <DbCodeTableXml> dbCodeTableXml = new List <DbCodeTableXml>();

            foreach (var codeTableXml in codeTableXmls)
            {
                dbCodeTableXml.Add(XmlUtil.ReadFromFile <DbCodeTableXml>(codeTableXml));
            }
            return(dbCodeTableXml);
        }
Пример #7
0
        public static IList <FileManagementConfig> ReadConfigFromDir()
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "FileManagement");

            FileUtil.ConfirmPath(fpath);
            string[] xmls = Directory.GetFiles(fpath, "*.xml", SearchOption.AllDirectories);
            IList <FileManagementConfig> dictXmlList = new List <FileManagementConfig>();

            foreach (var dict in xmls)
            {
                dictXmlList.Add(XmlUtil.ReadFromFile <FileManagementConfig>(dict));
            }
            return(dictXmlList);
        }
Пример #8
0
 //附加基本的列(若配置没有)
 public void AddBaseColumns(string baseFormFileName)
 {
     try
     {
         string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                     "form", baseFormFileName);
         var baseForm = XmlUtil.ReadFromFile <DataFormConfig>(fpath);
         foreach (var column in baseForm.Columns)
         {
             if (this.Columns.FirstOrDefault(n => n.Name.ToUpper() == column.Name.ToUpper()) == null)
             {
                 this.Columns.Add(column);
             }
         }
     }
     catch { }
 }
Пример #9
0
        public static IList <CustomScriptConfig> ReadConfigFromDir()
        {
            string fpath = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH,
                                        "Script");

            if (!Directory.Exists(fpath))
            {
                Directory.CreateDirectory(fpath);
            }
            string[] scriptXmls = Directory.GetFiles(fpath, "*.xml", SearchOption.AllDirectories);
            IList <CustomScriptConfig> scriptList = new List <CustomScriptConfig>();

            foreach (var scriptXml in scriptXmls)
            {
                scriptList.Add(XmlUtil.ReadFromFile <CustomScriptConfig>(scriptXml));
            }
            return(scriptList);
        }
Пример #10
0
        public static SiteFunConfig ReadConfig(string binPath)
        {
            string fpath = Path.Combine(binPath, AtawApplicationConfig.REAL_PATH, "Fun.xml");

            return(XmlUtil.ReadFromFile <SiteFunConfig>(fpath));
        }
Пример #11
0
 public static T XmlConfig<T>(this string fileName) where T : XmlConfigBase, new()
 {
     string path = Path.Combine(AtawAppContext.Current.BinPath, AtawApplicationConfig.REAL_PATH, fileName);
     return XmlUtil.ReadFromFile<T>(path);
 }
Пример #12
0
        public static AtawConfigInfo ReadConfig(string binPath)
        {
            string fpath = Path.Combine(binPath, AtawApplicationConfig.REAL_PATH, "ProductConfig.xml");

            return(XmlUtil.ReadFromFile <AtawConfigInfo>(fpath));
        }
Пример #13
0
        public static DocViewerConfig ReadConfig(string binPath)
        {
            string fpath = Path.Combine(binPath, AtawApplicationConfig.REAL_PATH, "DocViwer.xml");

            return(XmlUtil.ReadFromFile <DocViewerConfig>(fpath));
        }
Пример #14
0
        public static ThemeListConfig ReadConfig(string binPath)
        {
            string fpath = Path.Combine(binPath, AtawApplicationConfig.REAL_PATH, "ThemeList.xml");

            return(XmlUtil.ReadFromFile <ThemeListConfig>(fpath));
        }