Ejemplo n.º 1
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <returns></returns>
 public static bool SaveConfig(ScriptEventConfigInfo scripteventconfiginfo)
 {
     ScriptEventConfigFileManager scfm = new ScriptEventConfigFileManager();
     ScriptEventConfigFileManager.ConfigInfo = scripteventconfiginfo;
     return scfm.SaveConfig();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 返回配置类实例
        /// </summary>
        /// <returns></returns>
        public static ScriptEventConfigInfo LoadConfig()
        {
            try
            {
                ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, false);
            }
            catch
            {
                if (!File.Exists(ConfigFilePath))
                {
                    ScriptEventConfigFileManager secf = new ScriptEventConfigFileManager();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
            }

            return ConfigInfo as ScriptEventConfigInfo;
        }