GetMessages() public static method

Возвращает сообщения с указанными идентификаторами, либо если идентификаторы не указаны, возвращает текущие выделенные сообщения.
public static GetMessages ( IServiceProvider serviceProvider, IEnumerable messageIds ) : IEnumerable
serviceProvider IServiceProvider
messageIds IEnumerable
return IEnumerable
示例#1
0
 public CommandStatus QuerySetMessagesReadMarkStatus(
     ICommandContext context, int[] messageIds, bool isRead, bool markChilds)
 {
     return(QueryMessagesCommandStatus(context, messageIds).DisabledIfNot(
                () => ForumMessageCommandHelper.GetMessages(context, messageIds)
                .Any(msg => msg.CanSetMessageReadMark(isRead, markChilds))));
 }
示例#2
0
 public CommandStatus QuerySetMessagesRepliesAutoReadMarkStatus(
     ICommandContext context, int[] messageIds, bool isEnabled)
 {
     return(QueryMessagesCommandStatus(context, messageIds).DisabledIfNot(
                () => ForumMessageCommandHelper
                .GetMessages(context, messageIds)
                .Any(msg => msg.ReadReplies != isEnabled)));
 }
示例#3
0
 public void ExecuteSetMessagesRepliesAutoReadMark(
     ICommandContext context, int[] messageIds, bool isEnabled)
 {
     ForumHelper.SetMessageRepliesAutoReadMark(
         context,
         ForumMessageCommandHelper.GetMessages(context, messageIds).Cast <MsgBase>(),
         isEnabled);
 }
示例#4
0
 public CommandStatus QuerySetTopicReadMarkStatus(
     ICommandContext context, int[] messageIds, bool isRead)
 {
     return(QueryMessagesCommandStatus(context, messageIds).DisabledIfNot(
                () => ForumMessageCommandHelper.GetMessages(context, messageIds)
                .Select(msg => msg.Topic)
                .Any(msg => msg.CanSetMessageReadMark(isRead, true))));
 }
示例#5
0
 public void ExecuteRegetTopic(ICommandContext context, int[] messageIds)
 {
     foreach (var msg in ForumMessageCommandHelper.GetMessages(context, messageIds))
     {
         context
         .GetOutboxManager()
         .DownloadTopics
         .Add(
             SR.Forum.DownloadTopicRegetSource,
             msg.ID,
             msg.Subject);
     }
 }
示例#6
0
        public void ExecuteSetMessageReadMark(
            ICommandContext context, int[] messageIds, bool isRead, bool markChilds)
        {
            if (Features.Instance.ActiveFeature is Forum)
            {
                ForumDummyForm.Instance.StopMarkTimer();
            }

            ForumHelper.MarkMsgRead(
                context,
                ForumMessageCommandHelper.GetMessages(context, messageIds).Cast <MsgBase>(),
                isRead,
                markChilds);
        }
示例#7
0
        public void ExecuteSetTopicReadMark(ICommandContext context, int[] messageIds, bool isRead)
        {
            if (Features.Instance.ActiveFeature is Forum)
            {
                ForumDummyForm.Instance.StopMarkTimer();
            }

            ForumHelper.MarkMsgRead(
                context,
                ForumMessageCommandHelper
                .GetMessages(context, messageIds)
                .Select(msg => msg.Topic)
                .Cast <MsgBase>(),
                isRead,
                true);
        }
示例#8
0
 public CommandStatus QueryRateMessageStatus(ICommandContext context, int[] messageIds)
 {
     return(QueryMessagesCommandStatus(context, messageIds).DisabledIfNot(
                () => !ForumMessageCommandHelper.GetMessages(context, messageIds)
                .Any(msg => msg.UserID == Config.Instance.SelfId)));
 }