Exemplo n.º 1
0
        /// <summary>
        /// Event handler which is fired when the user selects to invite a member via the right-click context menu on the main tree.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem8_Click(object sender, System.EventArgs e)
        {
            string memId = null;

            //get selected member via the mouse point
            memId = memberTree.GetNodeAt(mousePoint.X, mousePoint.Y).Text;
            ConversationMonitor cm = getFocusedConversationMonitor();

            if (cm != null)
            {
                cm.sendInvite(memId);                   //send invite if conversation monitor already exists
            }
            else                                        //notify user that a conversation must be in place
            {
                MessageBox.Show("You do not have any active conversations. You must start a conversation before inviting members.", "No conversation available", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
            }
//			else					//otherwise create a new conversation monitor
//			{
//				cm = new ConversationMonitor(this,ref facade);
//				currentConversations.Add(cm);
//				cm.Closing+=new CancelEventHandler(cm_Closing);
//				cm.Activated+=new EventHandler(cm_Activated);
//				cm.Show();
//				cm.sendInvite(memId);
//			}
        }
Exemplo n.º 2
0
        /// <summary>
        /// Start a new conversation with the selected member.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem9_Click(object sender, System.EventArgs e)
        {
            string memId = null;

            //get selected member via the mouse point
            memId = memberTree.GetNodeAt(mousePoint.X, mousePoint.Y).Text;

            //check that member has not attempted to invite themselves
            if (memId == member.Id)
            {
                MessageBox.Show("You can not invite yourself to join a conversation.", "Invalid invitation", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
            }
            else
            {
                ConversationMonitor cm = new ConversationMonitor(this, ref facade);
                currentConversations.Add(cm);
                cm.Closing   += new CancelEventHandler(cm_Closing);
                cm.Activated += new EventHandler(cm_Activated);
                cm.Show();
                cm.sendInvite(memId);
            }
        }