void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { MessageTextViewMessageHighlightedEventHandler handler; if (!HighlightEventHandlers.TryGetValue(e.ChatView, out handler)) { return; } e.ChatView.OutputMessageTextView.MessageHighlighted -= handler; }
void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { MessageTextViewMessageHighlightedEventHandler handler; if (!HighlightEventHandlers.TryGetValue(e.ChatView, out handler)) { return; } e.ChatView.OutputMessageTextView.MessageHighlighted -= handler; // close possibly active indicator DisposeIndicator(e.ChatView); }
void OnChatViewManagerChatRemoved(object sender, ChatViewManagerChatRemovedEventArgs e) { MessageTextViewMessageHighlightedEventHandler handler; if (!HighlightEventHandlers.TryGetValue(e.ChatView, out handler)) { return; } e.ChatView.OutputMessageTextView.MessageHighlighted -= handler; HighlightEventHandlers.Remove(e.ChatView); // close possibly active indicator #if INDICATE_SHARP DisposeIndicator(e.ChatView); #elif MESSAGING_MENU_SHARP DisposeSource(e.ChatView); #endif }
void OnChatViewManagerChatAdded(object sender, ChatViewManagerChatAddedEventArgs e) { // we are only interested in highlights on person and group chats if (!(e.ChatView is PersonChatView) && !(e.ChatView is GroupChatView)) { return; } MessageTextViewMessageHighlightedEventHandler handler = delegate(object o, MessageTextViewMessageHighlightedEventArgs args) { OnChatViewMessageHighlighted(o, args, e.ChatView); }; e.ChatView.OutputMessageTextView.MessageHighlighted += handler; // keep a reference to the handler so we can cleanup it up later // in OnChatViewManagerChatRemoved() HighlightEventHandlers.Add(e.ChatView, handler); }