private void myMenuAddContactToolStripButton_Click(object sender, EventArgs e) { myContactWindow = new ContactsWindow(this, null, null); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); }
public void StartNewContact(String jabberID) { Hashtable properties = new Hashtable(); if (jabberID != null) { int dummy; if (Int32.TryParse(jabberID, out dummy)) { properties.Add("NTHomeTelephoneNumber", jabberID); } else { properties.Add("NTJabberID", jabberID); } myContactWindow = new ContactsWindow(this, null, properties); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); } }
private void myCallHistory_AddContactToolStripItem_Click(object sender, EventArgs e) { RadListBoxItem selectedItem = (RadListBoxItem)myCallHistoryListBox.SelectedItem; if (selectedItem != null) { CallRecord selectedCallRecord = (CallRecord)selectedItem.Tag; Hashtable properties = new Hashtable(); if (selectedCallRecord != null) { int dummy; if (Int32.TryParse(selectedCallRecord.NumberOrUsername, out dummy)) { properties.Add("NTHomeTelephoneNumber", selectedCallRecord.NumberOrUsername); } else { properties.Add("NTJabberID", selectedCallRecord.NumberOrUsername); } myContactWindow = new ContactsWindow(this, null, properties); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); } } }
private void viewContactContactsToolStripMenuItem_Click(object sender, EventArgs e) { RadListBoxItem selectedItem = (RadListBoxItem)myContactsListBox.SelectedItem; if (selectedItem != null) { NTContact selectedContact = (NTContact)selectedItem.Tag; myContactWindow = new ContactsWindow(this, selectedContact, null); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); } }
private void viewContactPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { if (myRosterListTreeView.SelectedNode != null) { if (myRosterListTreeView.SelectedNode.Level == 1) { Hashtable properties = new Hashtable(); properties.Add("NTJabberID", myRosterListTreeView.SelectedNode.Text); myContactWindow = new ContactsWindow(this, myContactsBook.List.getCandidatesForJabberID(myRosterListTreeView.SelectedNode.Text).Count > 0 ? (NTContact)myContactsBook.List.getCandidatesForJabberID(myRosterListTreeView.SelectedNode.Text)[0] : null, properties); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); } } }
private void xmppControl_OnSubscriptionRequest(object sender, XmppSubscriptionRequestEventArgs e) { Console.WriteLine("IM-SubscriptionRequest:" + "(" + e.From + ")"); if (MessageBox.Show("User " + e.From + " would like to add you to his/her contact list. Do you wish to accept?", "Subscription Request", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { e.Accept = true; } if (MessageBox.Show("Would you like to add " + e.From + " to your own contact list?", "Manage Contacts", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { Hashtable properties = new Hashtable(); properties.Add("NTJabberID", e.From); myContactWindow = new ContactsWindow(this, null, properties); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); } }
void tmplContactListItem_DoubleClick(object sender, EventArgs e) { Telerik.WinControls.UI.RadListBoxItem clickedItem = (Telerik.WinControls.UI.RadListBoxItem)sender; myContactWindow = new ContactsWindow(this, (NTContact)clickedItem.Tag, null); myContactWindow.FormClosing += new FormClosingEventHandler(myContactWindow_FormClosing); myContactWindow.Show(); }