示例#1
0
        public static TimerServiceConfig Get()
        {
            ISerializeTool tIXmlConfigTool = ToolFactory.Ioc.Get <IXmlSerializeTool>();
            var            path            = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, " /Config/TimerServiceConfig.xml");

            return(tIXmlConfigTool.DeserializeFromFile <TimerServiceConfig>(path));
        }
示例#2
0
        Dictionary <string, CacheDto> GetCacheFromFile()
        {
            var cacheList = _ISerializeTool.DeserializeFromFile <List <CacheDto> >(GetCacheFilePath());

            if (cacheList == null)
            {
                cacheList = new List <CacheDto>();
            }
            Dictionary <string, CacheDto> cacheDict = new Dictionary <string, CacheDto>(cacheList.Count);

            foreach (var item in cacheList)
            {
                cacheDict.Add(item.Key, item);
            }
            return(cacheDict);
        }