コード例 #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="generalconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(GeneralConfigInfo generalconfiginfo)
        {
            GeneralConfigFileManager gcf = new GeneralConfigFileManager();

            GeneralConfigFileManager.ConfigInfo = generalconfiginfo;
            return(gcf.SaveConfig());
        }
コード例 #2
0
        /// <summary>
        /// 返回配置类实例
        /// </summary>
        /// <returns></returns>
        public static GeneralConfigInfo LoadConfig()
        {
            try
            {
                if (!File.Exists(ConfigFilePath))
                {
                    GeneralConfigFileManager secf = new GeneralConfigFileManager();

                    ConfigInfo = new GeneralConfigInfo();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
                else
                {
                    ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
                }
            }
            catch
            {
                if (!File.Exists(ConfigFilePath))
                {
                    GeneralConfigFileManager secf = new GeneralConfigFileManager();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
            }
            return(ConfigInfo as GeneralConfigInfo);
        }
コード例 #3
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <param name="generalconfiginfo"></param>
 /// <returns></returns>
 public static bool SaveConfig(GeneralConfigInfo generalconfiginfo)
 {
     GeneralConfigFileManager gcf = new GeneralConfigFileManager();
     GeneralConfigFileManager.ConfigInfo = generalconfiginfo;
     return gcf.SaveConfig();
 }
コード例 #4
0
        /// <summary>
        /// 返回配置类实例
        /// </summary>
        /// <returns></returns>
        public static GeneralConfigInfo LoadConfig()
        {
            try
            {
                if (!File.Exists(ConfigFilePath))
                {
                    GeneralConfigFileManager secf = new GeneralConfigFileManager();

                    ConfigInfo = new GeneralConfigInfo();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
                else
                {
                    ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
                }
            }
            catch
            {
                if (!File.Exists(ConfigFilePath))
                {
                    GeneralConfigFileManager secf = new GeneralConfigFileManager();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
            }
            return ConfigInfo as GeneralConfigInfo;
        }