Exemplo n.º 1
0
 public SecurityWork(ICacheWork cacheWork, IMemberUserWork userWorker)
 {
     _userWorker = userWorker;
     _cacheManager = cacheWork;
     if (!_cacheManager.Contains(Security_Service_CacheKey))
     {
         _cacheManager.AddOrUpdate(Security_Service_CacheKey, new Dictionary<string, TokenUser>());
     }
     _dictToken = _cacheManager.GetData<Dictionary<string, TokenUser>>(Security_Service_CacheKey);
 }
Exemplo n.º 2
0
 public SecurityWork(ICacheWork cacheWork, IMemberUserWork userWorker)
 {
     _userWorker   = userWorker;
     _cacheManager = cacheWork;
     if (!_cacheManager.Contains(Security_Service_CacheKey))
     {
         _cacheManager.AddOrUpdate(Security_Service_CacheKey, new Dictionary <string, TokenUser>());
     }
     _dictToken = _cacheManager.GetData <Dictionary <string, TokenUser> >(Security_Service_CacheKey);
 }
Exemplo n.º 3
0
        static MessageManager()
        {
            _cacheManager = UnityMVC.Container.Resolve<ICacheWork>();
            _languageWork = UnityMVC.Container.Resolve<ILanguageWork>();
            _settingWork = UnityMVC.Container.Resolve<ISettingWork>();

            Reload();

            _cacheManager.AddOrUpdate(Message_Manager_Operation_Status_CacheKey, new Dictionary<OperationStatus, string>());
            _operationStatus = _cacheManager.GetData<Dictionary<OperationStatus, string>>(Message_Manager_Operation_Status_CacheKey);
            LoadOperationStatusKey();
        }
Exemplo n.º 4
0
        public static void Reload()
        {
            _cacheManager.Remove(Message_Manager_CacheKey);
            _cacheManager.AddOrUpdate(Message_Manager_CacheKey, new Dictionary <string, string>());
            _defaultLocaleResources = _cacheManager.GetData <Dictionary <string, string> >(Message_Manager_CacheKey);

            foreach (var resourceKey in _languageWork.AllResourceKeyCacheItems)
            {
                var resourceValue = _languageWork.GetResourceValue(_settingWork.GetDefaultSetting().Language, resourceKey);
                _defaultLocaleResources.Add(resourceKey.ResourceKey, resourceValue.ResourceValue);
            }
        }
Exemplo n.º 5
0
        static MessageManager()
        {
            _cacheManager = UnityMVC.Container.Resolve <ICacheWork>();
            _languageWork = UnityMVC.Container.Resolve <ILanguageWork>();
            _settingWork  = UnityMVC.Container.Resolve <ISettingWork>();

            Reload();

            _cacheManager.AddOrUpdate(Message_Manager_Operation_Status_CacheKey, new Dictionary <OperationStatus, string>());
            _operationStatus = _cacheManager.GetData <Dictionary <OperationStatus, string> >(Message_Manager_Operation_Status_CacheKey);
            LoadOperationStatusKey();
        }