Exemplo n.º 1
0
 public void SendAndClearMessageList()
 {
     ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList");
     if (this.Conversation == null)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. Conversation is null.");
         return;
     }
     if (this.messageList != null && this.messageList.Count > 0)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. Message list count: {0}", new object[]
         {
             this.messageList.Count
         });
         IIMModality iimmodality = this.Conversation.GetModality(1) as IIMModality;
         if (iimmodality == null)
         {
             ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. IIMModality is null.");
             return;
         }
         lock (this.lockObject)
         {
             foreach (Tuple <string, string> tuple in this.messageList)
             {
                 iimmodality.BeginSendMessage(tuple.Item1, tuple.Item2, new AsyncCallback(this.SendMessageCallback), iimmodality);
             }
             this.messageList.Clear();
             this.messageList = null;
         }
     }
 }
Exemplo n.º 2
0
 public void SendAndClearMessageList()
 {
     ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList");
     if (this.conversation == null)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. Conversation is null.");
         return;
     }
     if (this.messageList != null && this.messageList.Count > 0)
     {
         ExTraceGlobals.InstantMessagingTracer.TraceDebug <int>((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. Message list count: {0}", this.messageList.Count);
         IIMModality iimmodality = this.conversation.GetModality(1) as IIMModality;
         if (iimmodality == null)
         {
             ExTraceGlobals.InstantMessagingTracer.TraceError((long)this.GetHashCode(), "InstantMessageQueue.SendAndClearMessageList. IIMModality is null.");
             return;
         }
         lock (this.lockObject)
         {
             foreach (InstantMessageChat instantMessageChat in this.messageList)
             {
                 iimmodality.BeginSendMessage(instantMessageChat.ContentType, instantMessageChat.Message, new AsyncCallback(this.SendMessageCallback), iimmodality);
             }
             this.messageList.Clear();
             this.messageList = null;
         }
     }
 }