Ejemplo n.º 1
0
        /**
         * this method invites a new participant into the selected meeting.  First, the participant
         * URL is grabbed from the Invite field and serialized.  Then the serialized URL is passed to
         * the InviteAgent method in the local InfoAgent.  The InviteAgent method first gets the signatures
         * of all of the existing participants, and then signs the message and sends it to the invitee
         * */
        private void m_btnInvite_Click(object sender, System.EventArgs e)
        {
            //invite new participant to meeting:  strSelectedMtg
            string        strNewUrl = m_boxInvite.Text;
            StringBuilder strTest   = new StringBuilder();

            strTest.Append("we are inviting: ");
            strTest.Append(strNewUrl);
            string strNewUrlSerialized = Serializer.Serialize(strNewUrl);

            m_boxInvite.Text = strTest.ToString();


            myctx.ClearParameters();
            myctx.MethodName = "InviteAgent";

            MeetingRequestMsg newMsg = new MeetingRequestMsg();

            newMsg.Sender = cert.GetName();

            newMsg.SenderUrl = strMyUrl;

            ArrayList lstParticipants = pDAO.GetParticipants(strSelectedMtg);

            foreach (MeetingParticipant mp in lstParticipants)
            {
                newMsg.m_lstParticipants.Add(mp);
            }

            newMsg.MeetingID    = strSelectedMtg;
            newMsg.MeetingTopic = mDAO.GetMeetingTopic(strSelectedMtg);

            string strNewMsgSerialized = Serializer.Serialize(newMsg.ToXml());

            myctx.AddParameter(strNewMsgSerialized);
            myctx.AddParameter(strNewUrlSerialized);

            object objectRes = null;

            try
            {
                objectRes = myexec.Execute(myctx);
            }
            catch (Exception exc)
            {
                string strBsg = exc.Message;
                return;
            }

            StringBuilder sbResult = new StringBuilder("Added ");

            sbResult.Append(strNewUrl).Append(" to meeting list");
            m_boxInvite.Text = sbResult.ToString();
            UpdateParticipantsList();
        }
        private void UpdateParticipantsList()
        {
            m_boxParticipants.Items.Clear();

            ArrayList lstParticipants = pDAO.GetParticipants(strSelectedMtg);

            foreach (MeetingParticipant mp in lstParticipants)
            {
                StringBuilder strB = new StringBuilder(mp.Name);
                strB.Append(" @ ");
                strB.Append(mp.Location);

                m_boxParticipants.Items.Add(strB.ToString());
            }
        }