示例#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);
//			}
        }
示例#2
0
        private void menuItem2_Click(object sender, System.EventArgs e)
        {
            ConversationMonitor cm = new ConversationMonitor(this, ref facade);

            currentConversations.Add(cm);
            cm.Closing   += new CancelEventHandler(cm_Closing);
            cm.Activated += new EventHandler(cm_Activated);
            cm.Show();
            mostRecentlyFocusedMonitor = cm;
        }
示例#3
0
        public void joinConversation(InviteForm inv)
        {
            inv.Close();
            ConversationMonitor cm = new ConversationMonitor(this, ref facade, inv.Invitation.InvitedConversation.Id);

            cm.ConversationId = inv.Invitation.InvitedConversation.Id;
            currentConversations.Add(cm);
            cm.Closing   += new CancelEventHandler(cm_Closing);
            cm.Activated += new EventHandler(cm_Activated);
            cm.Show();
            mostRecentlyFocusedMonitor = cm;
        }
示例#4
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);
            }
        }
示例#5
0
 /// <summary>
 /// Eventhandler raised when a conversation monitor is activated. Set the most recently focused monitor to the one which was just activated.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cm_Activated(object sender, EventArgs e)
 {
     mostRecentlyFocusedMonitor = (ConversationMonitor)sender;
 }