예제 #1
0
 ///<summary>
 ///	WindowDeleted
 /// Cleans up the conversation object with the ConversationManager
 ///</summary>
 private void WindowDeleted(object sender, DeleteEventArgs args)
 {
     if (conv != null)
     {
         Logger.Debug("Window was destroyed, calling ConversationManager.Destroy on conversation");
         TearDownConversationEvents();
         ConversationManager.Destroy(conv);
         conv = null;
     }
 }
예제 #2
0
        /// <summary>
        /// CleanUpConversation
        /// Removes all event handlers and optionally destroys the conversation
        /// </summary>
        private void CleanUpConversation(Conversation conversation, bool destroyit)
        {
            conversation.MessageReceived    -= OnTextAdditionalMessageReceived;
            conversation.MediaChannelOpened -= OnMediaChannelOpened;
            conversation.MediaChannelClosed -= OnMediaChannelClosed;
            conversation.TextChannelOpened  -= OnTextChannelOpened;
            if (pendingData.ContainsKey(conversation.PeerUser.ID))
            {
                pendingData.Remove(conversation.PeerUser.ID);
            }

            if (destroyit)
            {
                ConversationManager.Destroy(conversation);
            }
        }