Пример #1
0
 public SessionTabItem(InstanceAnswerPro.Core.Community.CommunitySession communitySession)
 {
     this.imMessageList     = new ArrayList();
     this._communitySession = communitySession;
     this._communitySession.MessageReceived       = (EventHandler <CommunityMessageReceivedEventArgs>)Delegate.Combine(this._communitySession.MessageReceived, new EventHandler <CommunityMessageReceivedEventArgs>(this.OnCommunityMessageReceived));
     this._communitySession.InfoMessageReceived   = (EventHandler <InfoMessageReceivedEventArgs>)Delegate.Combine(this._communitySession.InfoMessageReceived, new EventHandler <InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
     this._communitySession.SendMessageCompleted += new EventHandler <CommandKeyedCallbackArgs <MessagePack> >(this.session_SendMessageCompleted);
 }
Пример #2
0
 public SessionTabItem(InstanceAnswerPro.Core.Community.CommunitySession communitySession)
 {
     this.imMessageList = new ArrayList();
     this._communitySession = communitySession;
     this._communitySession.MessageReceived = (EventHandler<CommunityMessageReceivedEventArgs>)Delegate.Combine(this._communitySession.MessageReceived, new EventHandler<CommunityMessageReceivedEventArgs>(this.OnCommunityMessageReceived));
     this._communitySession.InfoMessageReceived = (EventHandler<InfoMessageReceivedEventArgs>)Delegate.Combine(this._communitySession.InfoMessageReceived, new EventHandler<InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
     this._communitySession.SendMessageCompleted += new EventHandler<CommandKeyedCallbackArgs<MessagePack>>(this.session_SendMessageCompleted);
 }
Пример #3
0
 public void Close()
 {
     if (this._contactSession != null)
     {
         this._contactSession.MessageReceived       = (EventHandler <ContactMessageReceivedEventArgs>)Delegate.Remove(this._contactSession.MessageReceived, new EventHandler <ContactMessageReceivedEventArgs>(this.OnContactMessageReceived));
         this._contactSession.InfoMessageReceived   = (EventHandler <InfoMessageReceivedEventArgs>)Delegate.Remove(this._contactSession.InfoMessageReceived, new EventHandler <InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
         this._contactSession.SendMessageCompleted -= new EventHandler <CommandKeyedCallbackArgs <MessagePack> >(this.session_SendMessageCompleted);
         ComponentManager.GetContactSessionManager().DestroySession(this._contactSession);
         this._contactSession = null;
     }
     if (this._communitySession != null)
     {
         this._communitySession.MessageReceived       = (EventHandler <CommunityMessageReceivedEventArgs>)Delegate.Remove(this._communitySession.MessageReceived, new EventHandler <CommunityMessageReceivedEventArgs>(this.OnCommunityMessageReceived));
         this._communitySession.InfoMessageReceived   = (EventHandler <InfoMessageReceivedEventArgs>)Delegate.Remove(this._communitySession.InfoMessageReceived, new EventHandler <InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
         this._communitySession.SendMessageCompleted -= new EventHandler <CommandKeyedCallbackArgs <MessagePack> >(this.session_SendMessageCompleted);
         ComponentManager.GetCommunitySessionManager().DestroySession(this._communitySession);
         this._communitySession = null;
     }
 }
Пример #4
0
 public void Close()
 {
     if (this._contactSession != null)
     {
         this._contactSession.MessageReceived = (EventHandler<ContactMessageReceivedEventArgs>)Delegate.Remove(this._contactSession.MessageReceived, new EventHandler<ContactMessageReceivedEventArgs>(this.OnContactMessageReceived));
         this._contactSession.InfoMessageReceived = (EventHandler<InfoMessageReceivedEventArgs>)Delegate.Remove(this._contactSession.InfoMessageReceived, new EventHandler<InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
         this._contactSession.SendMessageCompleted -= new EventHandler<CommandKeyedCallbackArgs<MessagePack>>(this.session_SendMessageCompleted);
         ComponentManager.GetContactSessionManager().DestroySession(this._contactSession);
         this._contactSession = null;
     }
     if (this._communitySession != null)
     {
         this._communitySession.MessageReceived = (EventHandler<CommunityMessageReceivedEventArgs>)Delegate.Remove(this._communitySession.MessageReceived, new EventHandler<CommunityMessageReceivedEventArgs>(this.OnCommunityMessageReceived));
         this._communitySession.InfoMessageReceived = (EventHandler<InfoMessageReceivedEventArgs>)Delegate.Remove(this._communitySession.InfoMessageReceived, new EventHandler<InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
         this._communitySession.SendMessageCompleted -= new EventHandler<CommandKeyedCallbackArgs<MessagePack>>(this.session_SendMessageCompleted);
         ComponentManager.GetCommunitySessionManager().DestroySession(this._communitySession);
         this._communitySession = null;
     }
 }