예제 #1
0
        public ApiResult SystemMessageService()
        {
            var result       = new ApiResult();
            var items        = typeof(MessageCategory).GetItems();
            var categoryList = new List <SystemMessageCategory>();

            foreach (var item in items)
            {
                var category = new SystemMessageCategory();
                category.Category = (MessageCategory)((int)item.Value);
                category.Name     = category.Category.Description();
                int unreadCount;
                category.FirstMessage = _systemMessageService.GetFirstMessage(category.Category,
                                                                              AuthorizedUser.Id, out unreadCount);
                category.UnreadCount = unreadCount;

                categoryList.Add(category);
            }

            result.SetData(categoryList);

            return(result);
        }
예제 #2
0
 public SystemMessage(SystemMessageCategory category, string msg, params object[] parameters)
 {
     this.Message  = new HeroesString(msg, parameters);
     this.Category = (byte)category;
 }
예제 #3
0
 public SystemMessage(SystemMessageCategory category, string msg)
 {
     this.Message  = new HeroesString(msg);
     this.Category = (byte)category;
 }
예제 #4
0
 public SystemMessage(SystemMessageCategory category, HeroesString msg)
 {
     this.Message  = msg;
     this.Category = (byte)category;
 }