protected virtual void OnPersonsRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); IList <PersonModel> persons = GetSelectedPersons(); if (persons == null) { return; } // this is a generic implemention that should be able to open/create // a private chat in most cases, as it depends what OpenChat() // of the specific protocol actually expects/needs foreach (PersonModel person in persons) { PersonChatModel personChat = new PersonChatModel( person, person.ID, person.IdentityName, null ); ThreadPool.QueueUserWorkItem(delegate { try { ChatModel.ProtocolManager.OpenChat( Frontend.FrontendManager, personChat ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } }
public XmppPersonChatView(PersonChatModel personChat) : base(personChat) { Trace.Call(personChat); OutputMessageTextView.PopulatePopup += _OnOutputMessageTextViewPopulatePopup; ChatStateStartPosition = new Gtk.TextMark("ChatStateStartPosition", true); IsDisposed = false; }
public PersonChatView(PersonChatModel chat) : base(chat) { Trace.Call(chat); PersonChatModel = chat; Add(OutputScrolledWindow); }
public IrcPersonChatView(PersonChatModel personChat) : base(personChat) { Trace.Call(personChat); OutputMessageTextView.PopulatePopup += OnOutputMessageTextViewPopulatePopup; }
public TwitterPersonChatView(PersonChatModel personChat) : base(personChat) { Trace.Call(personChat); }
protected virtual void OnPersonsRowActivated(object sender, Gtk.RowActivatedArgs e) { Trace.Call(sender, e); IList <PersonModel> persons = GetSelectedPersons(); if (persons == null || persons.Count == 0) { return; } var protocolManager = ProtocolManager; if (protocolManager == null) { #if LOG4NET _Logger.WarnFormat( "{0}.OnPersonsRowActivated(): ProtocolManager is null, " + "bailing out!", this ); #endif return; } // jump to person chat if available foreach (var chatView in Frontend.MainWindow.ChatViewManager.Chats) { if (!(chatView is PersonChatView)) { continue; } var personChatView = (PersonChatView)chatView; if (personChatView.PersonModel == persons[0]) { Frontend.MainWindow.ChatViewManager.CurrentChatView = personChatView; return; } } // this is a generic implemention that should be able to open/create // a private chat in most cases, as it depends what OpenChat() // of the specific protocol actually expects/needs foreach (PersonModel person in persons) { PersonChatModel personChat = new PersonChatModel( person, person.ID, person.IdentityName, null ); ThreadPool.QueueUserWorkItem(delegate { try { protocolManager.OpenChat( Frontend.FrontendManager, personChat ); } catch (Exception ex) { Frontend.ShowException(ex); } }); } }
protected virtual void OnChatOpenChatButtonClicked(object sender, EventArgs e) { Trace.Call(sender, e); try { OpenChatDialog dialog = new OpenChatDialog(this); int res = dialog.Run(); var chatView = Notebook.CurrentChatView; if (chatView == null) { return; } // FIXME: REMOTING CALL var manager = chatView.ChatModel.ProtocolManager; if (manager == null) { return; } ChatModel chat; switch (dialog.ChatType) { case ChatType.Group: chat = new GroupChatModel( dialog.ChatName, dialog.ChatName, null ); break; case ChatType.Person: chat = new PersonChatModel( null, dialog.ChatName, dialog.ChatName, null ); break; default: throw new ApplicationException( String.Format( _("Unknown ChatType: {0}"), dialog.ChatType ) ); } dialog.Destroy(); if (res != (int)Gtk.ResponseType.Ok) { return; } ThreadPool.QueueUserWorkItem(delegate { try { manager.OpenChat(Frontend.FrontendManager, chat); } catch (Exception ex) { Frontend.ShowException(this, ex); } }); } catch (Exception ex) { Frontend.ShowException(this, ex); } }