public SessionTabItem(InstanceAnswerPro.Core.ContactSession session)
 {
     this.imMessageList   = new ArrayList();
     this._contactSession = session;
     this.buddyField      = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(session.Uin, true);
     this._contactSession.MessageReceived       = (EventHandler <ContactMessageReceivedEventArgs>)Delegate.Combine(this._contactSession.MessageReceived, new EventHandler <ContactMessageReceivedEventArgs>(this.OnContactMessageReceived));
     this._contactSession.InfoMessageReceived   = (EventHandler <InfoMessageReceivedEventArgs>)Delegate.Combine(this._contactSession.InfoMessageReceived, new EventHandler <InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
     this._contactSession.SendMessageCompleted += new EventHandler <CommandKeyedCallbackArgs <MessagePack> >(this.session_SendMessageCompleted);
 }
 public SessionTabItem(InstanceAnswerPro.Core.ContactSession session)
 {
     this.imMessageList = new ArrayList();
     this._contactSession = session;
     this.buddyField = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(session.Uin, true);
     this._contactSession.MessageReceived = (EventHandler<ContactMessageReceivedEventArgs>)Delegate.Combine(this._contactSession.MessageReceived, new EventHandler<ContactMessageReceivedEventArgs>(this.OnContactMessageReceived));
     this._contactSession.InfoMessageReceived = (EventHandler<InfoMessageReceivedEventArgs>)Delegate.Combine(this._contactSession.InfoMessageReceived, new EventHandler<InfoMessageReceivedEventArgs>(this.OnInfoMessageReceived));
     this._contactSession.SendMessageCompleted += new EventHandler<CommandKeyedCallbackArgs<MessagePack>>(this.session_SendMessageCompleted);
 }
 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;
     }
 }
 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;
     }
 }