Exemplo n.º 1
0
        /// <summary>
        /// 初始化 UI窗体预设 路径数据
        /// </summary>
        /// <param name="pathdata"></param>
        private void InitUIFormPathData(string pathdata)
        {
            IConfigManager config = new ConfigManagerByJson(pathdata);

            if (_dicFormsPaths != null)
            {
                _dicFormsPaths = config.AppSetting;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化语言缓存集合
        /// </summary>
        /// <param name="LanguagePath">语言json文件路径</param>
        private static void InitLanguageCache(LanguageType type)
        {
            string LanguagePath = null;

            switch (type)
            {
            case LanguageType.CN:
                LanguagePath = "LauguageJSONConfig_CN";
                break;

            case LanguageType.EN:
                LanguagePath = "LauguageJSONConfig";
                break;
            }
            IConfigManager config = new ConfigManagerByJson(LanguagePath);

            if (config != null)
            {
                _DicLanguageCache.Clear();
                _DicLanguageCache = config.AppSetting;
            }
        }
        /// <summary>
        /// 初始化语言缓存集合
        /// </summary>
        private void InitLanguageCache(LanguageType type)
        {
            string LanguagePath = null;

            switch (type)
            {
            case LanguageType.Cn:
                LanguagePath = UIFrameSysDefine.PATH_LANGUAGE_CN;
                break;

            case LanguageType.En:
                LanguagePath = UIFrameSysDefine.PATH_LANGUAGE_EN;
                break;
            }
            IConfigManager config = new ConfigManagerByJson(LanguagePath);

            if (config != null)
            {
                _dicLanguageCache.Clear();
                _dicLanguageCache = config.AppSetting;
            }
        }
Exemplo n.º 4
0
        private static string strLogBufferNumber = null;    //日志缓存最大容量



        /// <summary>
        /// 静态构造函数
        /// </summary>
        static Log()
        {
            //日志缓存数据
            _TempLogArray = new List <string>();

            //日志文件路径
            IConfigManager configMgr = new ConfigManagerByJson(SysDefine.SYS_PATN_LOG_CONFIG_INFO);

            //PC与编辑器环境下的路径,使用配置文件。
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            //string strPCTruePath = configMgr.AppSetting[JSON_CONFIG_LOG_DRIVE_NAME] + ":\\" + configMgr.AppSetting[JSON_CONFIG_LOG_PATH] + ".txt";
            string strPCTruePath = Application.dataPath + configMgr.AppSetting[JSON_CONFIG_LOG_PATH] + ".txt";
            _LogPath = strPCTruePath;
#endif

            //日志状态(部署模式)
            strLogState = configMgr.AppSetting[JSON_CONFIG_LOG_STATE];
            //日志最大容量
            strLogMaxCapacity = configMgr.AppSetting[JSON_CONFIG_LOG_MAX_CAPACITY];
            //日志缓存容量
            strLogBufferNumber = configMgr.AppSetting[JSON_CONFIG_LOG_BUFFER_NUMBER];

            //日志文件路径(移动端)
            if (string.IsNullOrEmpty(_LogPath))
            {
                _LogPath = UnityEngine.Application.persistentDataPath + "//" + JSON_CONFIG_LOG_DEFAULT_PATH; // todo 测试"/AppLog/" + configMgr.AppSetting[JSON_CONFIG_LOG_PATH] + ".txt";
            }

            //日志状态(部署模式)
            if (!string.IsNullOrEmpty(strLogState))
            {
                switch (strLogState)
                {
                case JSON_CONFIG_LOG_STATE_DEVELOP:
                    _LogState = State.Develop;
                    break;

                case JSON_CONFIG_LOG_STATE_SPECIAL:
                    _LogState = State.Speacial;
                    break;

                case JSON_CONFIG_LOG_STATE_DEPLOY:
                    _LogState = State.Deploy;
                    break;

                case JSON_CONFIG_LOG_STATE_STOP:
                    _LogState = State.Stop;
                    break;

                default:
                    _LogState = State.Stop;
                    break;
                }
            }
            else
            {
                _LogState = State.Stop;
            }

            //日志最大容量
            if (!string.IsNullOrEmpty(strLogMaxCapacity))
            {
                _LogMaxCapacity = Convert.ToInt32(strLogMaxCapacity);
            }
            else
            {
                _LogMaxCapacity = LOG_DEFAULT_MAX_CACITY_NUMBER;
            }

            //日志缓存最大容量
            if (!string.IsNullOrEmpty(strLogBufferNumber))
            {
                _LogBufferNumber = Convert.ToInt32(strLogBufferNumber);
            }
            else
            {
                _LogBufferNumber = LOG_DEFAULT_MAX_LOG_BUFFER_NUMBER;
            }
        }//Log_end(构造函数)