Example #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <returns></returns>
        public static bool SaveConfig(ScriptEventConfigInfo scripteventconfiginfo)
        {
            ScriptEventConfigFileManager scfm = new ScriptEventConfigFileManager();

            ScriptEventConfigFileManager.ConfigInfo = scripteventconfiginfo;
            return(scfm.SaveConfig());
        }
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static ScheduleConfigInfo LoadConfig()
 {
     try
     {
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     catch
     {
         if (!File.Exists(ConfigFilePath))
         {
             ScriptEventConfigFileManager secf = new ScriptEventConfigFileManager();
             secf.SaveConfig(ConfigFilePath, ConfigInfo);
         }
     }
     return(ConfigInfo as ScheduleConfigInfo);
 }
        /// <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;
        }
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <returns></returns>
 public static bool SaveConfig(ScriptEventConfigInfo scripteventconfiginfo)
 {
     ScriptEventConfigFileManager scfm = new ScriptEventConfigFileManager();
     ScriptEventConfigFileManager.ConfigInfo = scripteventconfiginfo;
     return scfm.SaveConfig();
 }