Example #1
0
        /// <summary>
        /// 加载配置
        /// </summary>
        /// <param name="path"></param>
        public void LoadConfigs(IConfigParam param)
        {
            try
            {
                UserAppConfigParam appConfig = param as UserAppConfigParam;
                if (File.Exists(appConfig.ConfigPath))
                {
                    UserAppConfig config = SerializeHelper.Load(typeof(UserAppConfig), appConfig.ConfigPath) as UserAppConfig;
                    if (config != null)
                    {
                        this.公共缓存配置目录  = config.公共缓存配置目录;
                        this.衍生品缓存配置目录 = config.衍生品缓存配置目录;
                        this.权益缓存配置目录  = config.权益缓存配置目录;
                        this.固收缓存配置目录  = config.固收缓存配置目录;

                        this.分行策略     = config.分行策略;
                        this.时间戳提取策略  = config.时间戳提取策略;
                        this.缓存匹配策略列表 = new List <CachePattern>(config.缓存匹配策略列表);
                    }
                    else
                    {
                        Init();
                    }
                }
                else
                {
                    Init();
                }
            }
            catch (Exception ex)
            {
                AppConfigManage.LogError(string.Format("加载用户应用程序配置错误:{0};StackTrace:{1}", ex.Message, ex.StackTrace));
                Init();
            }
        }
Example #2
0
        /// <summary>
        /// 保存配置
        /// </summary>
        /// <param name="path"></param>
        public void SaveConfigs(IConfigParam param)
        {
            UserAppConfigParam appConfig = param as UserAppConfigParam;

            SerializeHelper.Save(this, appConfig.ConfigPath);
        }