/// <summary> /// 表情管理构造器 /// </summary> public EmotionService() { emotionRepository = new Repository<EmotionCategory>(); //获取表情相关配置 _emotionSettings = DIContainer.Resolve<ISettingsManager<EmotionSettings>>().Get(); //读取目录下的表情包 _categories = new List<EmotionCategory>(); DirectoryInfo dir = new DirectoryInfo(WebUtility.GetPhysicalFilePath(_emotionSettings.EmoticonPath)); foreach (var info in dir.GetDirectories()) { PopulateEmotionCategory(info.Name, info.FullName); } }
private List <EmotionCategory> _categories = null; //表情分类集合 /// <summary> /// 表情管理构造器 /// </summary> public EmotionService() { emotionRepository = new Repository <EmotionCategory>(); //获取表情相关配置 _emotionSettings = DIContainer.Resolve <ISettingsManager <EmotionSettings> >().Get(); //读取目录下的表情包 _categories = new List <EmotionCategory>(); DirectoryInfo dir = new DirectoryInfo(WebUtility.GetPhysicalFilePath(_emotionSettings.EmoticonPath)); foreach (var info in dir.GetDirectories()) { PopulateEmotionCategory(info.Name, info.FullName); } }