コード例 #1
0
        private HashtagFeedToken getHashtagFeedToken(string hashtag, DiscussionSortFields? field, CommonEnums.SortDirections? dir, int pageSize, bool showTitle, bool showCloseBtn, Guid? uid = null)
        {
            var data = new HashtagFeedToken
            {
                Title               = hashtag + " feed",
                Hashtag             = hashtag,
                HashtagId           = -1,
                UserCoursesPageSize = pageSize,
                ShowTitle           = showTitle,
                ShowCloseBtn        = showCloseBtn
            };

            if (!String.IsNullOrEmpty(hashtag))
            {
                long? hashtagId;
                string error;
                data.Messages = _discussionServices.GetHashtagFeed(hashtag.Replace("#", string.Empty), field ?? DiscussionSortFields.AddOn, dir ?? CommonEnums.SortDirections.desc, out hashtagId, out error).ToArray();
                data.HashtagId = hashtagId;
            }
            else if (uid != null)
            {
                data.Messages = _discussionServices.GetMessageFeed((Guid)uid).ToArray();
            }
            else
            {
                data.Messages = new MessageViewDTO[0];
            }

            return data;
        }
コード例 #2
0
 public ActionResult IFrameMessage(Guid id)
 {
     var message = _discussionServices.GetMessageFeed(id).ToArray();
     var token = new HashtagFeedToken
     {
         Title               = string.Empty,
         Hashtag             = string.Empty,
         Messages            = message,
         HashtagId           = -1,
         Uid                 = id,
         UserCoursesPageSize = 3,
         ShowTitle           = false,
         ShowCloseBtn        = true
     };
     return View("IFrameFeed",token);
 }