/** * this method requests a resource to be added to the meeting, by sending * out a RecommendationRequest Context Message to the local InfoAgent * */ private void m_btnReq_Click(object sender, System.EventArgs e) { MeetingRequestMsg mtgReq = new MeetingRequestMsg(); mtgReq.MeetingID = strSelectedMtg; mtgReq.MeetingTopic = mDAO.GetMeetingTopic(strSelectedMtg); mtgReq.Sender = me.Name; mtgReq.SenderUrl = strMyUrl; mtgReq.m_lstParticipants = pDAO.GetParticipants(strSelectedMtg); RecommendationRequestCtxMsg recReqCtxMsg = new RecommendationRequestCtxMsg(mtgReq); recReqCtxMsg.Type = enuContextMsgType.RecommendationRequest; string strS = recReqCtxMsg.ToXml(); myctx.ClearParameters(); myctx.MethodName = "RequestRecommendation"; myctx.AddParameter(Serializer.Serialize(strS)); Object objRes = null; try { objRes = myexec.Execute(myctx); } catch (Exception ex) { string strExceptionMsg = ex.Message; } }
/** * 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(); }