示例#1
0
        /// <summary>
        ///  TODO config 的获取方法可能需要修改
        /// </summary>
        /// <returns></returns>
        public MWConfig GetConfig()
        {
            MWConfig mWConfig = new MWConfig();
            string   sql      = "select * from config";

            var rows = _theDataSource.SelectList(sql);

            for (int i = 0; i < rows.Count; i++)
            {
                if (rows[i]["key"].ToString() == "show_type")
                {
                    mWConfig.ShowType = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "image_background")
                {
                    mWConfig.ImageBackground = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "show_animation")
                {
                    mWConfig.ShowAnimation = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_curvestagger")
                {
                    mWConfig.CutEffectDuringCurvestagger = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_leftrightadjust")
                {
                    mWConfig.CutEffectDuringLeftRightAdjust = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_middisperse")
                {
                    mWConfig.CutEffectDuringMidDisperse = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_stars")
                {
                    mWConfig.CutEffectDuringStars = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_updownadjust")
                {
                    mWConfig.CutEffectDuringUpDownAdjust = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "cuteffectduring_frontbackrightpullopen")
                {
                    mWConfig.CutEffectDuringFrontBackRightPullOpen = int.Parse(rows[i]["value"].ToString());
                }
                if (rows[i]["key"].ToString() == "show_config")
                {
                    mWConfig.ShowConfig = rows[i]["value"].ToString();
                }
                if (rows[i]["key"].ToString() == "theme_id")
                {
                    mWConfig.ThemeId = int.Parse(rows[i]["value"].ToString());
                }
            }


            return(mWConfig);
        }
示例#2
0
        public AppConfig GetConfigByMWConfig(MWConfig mwConfig, string key)
        {
            AppConfig appConfig = new AppConfig();

            if (key == KEY_THEME_ID)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.ThemeId.ToString();
            }

            if (key == KEY_SHOW_CONFIG)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.ShowConfig.ToString();
            }

            if (key == KEY_CutEffectDuring_CurveStagger)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringCurvestagger.ToString();
            }

            if (key == KEY_CutEffectDuring_LeftRightAdjust)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringLeftRightAdjust.ToString();
            }

            if (key == KEY_CutEffectDuring_MidDisperseAdjust)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringMidDisperse.ToString();
            }

            if (key == KEY_CutEffectDuring_Stars)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringStars.ToString();
            }

            if (key == KEY_CutEffectDuring_UpDownAdjust)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringUpDownAdjust.ToString();
            }

            if (key == KEY_CutEffectDuring_FrontBackUnfold)
            {
                appConfig.key   = key;
                appConfig.value = mwConfig.CutEffectDuringFrontBackRightPullOpen.ToString();
            }

            return(appConfig);
        }
示例#3
0
        public void InitData()
        {
            // 初始化
            _config = _manager.globalData.GetConfig();

            if (_config.ShowType == MWConfig.ShowType_Common)
            {
                // 初始化
                _daoSubService = new CommonSubDaoService();
            }
            else
            {
                _daoSubService = new CustomSubDaoService();
            }

            GetEnterprises();
            GetActivities();
            GetProducts();
        }
示例#4
0
 /// <summary>
 ///  设置配置文件
 /// </summary>
 /// <param name="mwConfig"></param>
 public void SetMWConfig(MWConfig mwConfig)
 {
     _mwConfig = mwConfig;
 }