private void delete_Button_Click(object sender, EventArgs e) { try { if (this.tb_TemplateId_Delete.Text != "") { this.adhocConfTemplate = new AdhocConfTemplateParamEx(); adhocConfTemplate.adhocConfTemplateId = this.tb_TemplateId_Delete.Text.ToString(); } else { throw new Exception("The adhocConfTemplateId is empty"); } this.DialogResult = DialogResult.Yes; } catch (Exception error) { MessageBox.Show(error.ToString()); } }
private void Add_Button_Click(object sender, EventArgs e) { try { // 会议模板添加到的组织 this.orgId = this.tb_orgId_Add.Text.ToString(); // Adhoc会议模板参数 this.adhocConfTemplate = new AdhocConfTemplateParamEx(); // Adhoc模板ID, 新增时为0 adhocConfTemplate.adhocConfTemplateId = this.tb_TemplateId_Add.Text.ToString(); // 会议模板名称 adhocConfTemplate.name = this.tb_TemplateName_Add.Text.ToString(); // 会议激活号码 adhocConfTemplate.accessCode = this.tb_AccessCode_Add.Text.ToString(); adhocConfTemplate.duration = this.tb_Duration_Add.Text.ToString(); // 计费码 adhocConfTemplate.billCode = this.tb_billcode_Add.Text.ToString(); // adhocConfTemplate.password = this.tb_Password_Add.Text.ToString(); // 多画面资源数 adhocConfTemplate.cpResource = Convert.ToInt32(this.tb_cpResource_Add.Text.ToString()); // 速率 adhocConfTemplate.rate = this.tb_Rate_Add.Text.ToString(); // 媒体流加密方式,0:自动协商是否使用加密 adhocConfTemplate.mediaEncryptType = Convert.ToInt32(this.tb_mediaEncryptType_Add.Text.ToString()); // 是否支持直播功能, 0:不支持 1:支持 adhocConfTemplate.isLiveBroadcast = Convert.ToInt32(this.tb_isLiveBroadcast_Add.Text.ToString()); // 是否支持录播功能, 0:不支持 1:支持 adhocConfTemplate.isRecording = Convert.ToInt32(this.tb_isRecording_Add.Text.ToString()); // 胶片演示方式 adhocConfTemplate.presentation = 0; // 辅流视频参数 VideoParamEx videoParam = new VideoParamEx(); // 视频协议为H.261协议 videoParam.protocol = 1; // 视频格式为Auto videoParam.format = 0; adhocConfTemplate.presentationVideo = videoParam; // 会议主会场 //adhocConfTemplate.mainSiteUri = "01033001"; // 会议通知信息 ConferenceNoticeEx notice = new ConferenceNoticeEx(); // 邮箱地址 notice.email = "*****@*****.**"; // 通知信息内容 notice.content = "0"; // 电话号码 notice.telephone = "051269993940"; adhocConfTemplate.notice = notice; List <SiteInfoEx> sites = new List <SiteInfoEx>(); //新建一个SiteInfoEx对象 SiteInfoEx siteInfo1 = new SiteInfoEx(); //会场URI为01033001 siteInfo1.uri = this.tb_Site1_URI_Add.Text.ToString(); //会场速率为1920k siteInfo1.rate = this.tb_Site1_Rate_Add.Text.ToString(); //会场名称为site1 siteInfo1.name = this.tb_Site1_Name_Add.Text.ToString(); //呼叫方式为MCU主动呼叫会场 siteInfo1.dialingMode = Convert.ToInt32(this.tb_Site1_Call_Add.Text.ToString()); //会场来源为内部会场 siteInfo1.from = Convert.ToInt32(this.tb_Site1_Come_Add.Text.ToString()); //会场类型为H.323会场类型 siteInfo1.type = Convert.ToInt32(this.tb_Site1_Type_Add.Text.ToString()); //会场视频格式为Auto siteInfo1.videoFormat = Convert.ToInt32(this.tb_Site1_VF_Add.Text.ToString()); //会场视频协议为H.261 siteInfo1.videoProtocol = Convert.ToInt32(this.tb_Site1_VP_Add.Text.ToString());; //预约会议需要两个以上会场,所以再新建一个会场 SiteInfoEx siteInfo2 = new SiteInfoEx(); siteInfo2.uri = this.tb_Site2_URI_Add.Text.ToString(); siteInfo2.rate = this.tb_Site2_Rate_Add.Text.ToString(); siteInfo2.name = this.tb_Site2_Name_Add.Text.ToString(); siteInfo2.dialingMode = Convert.ToInt32(this.tb_Site2_Call_Add.Text.ToString()); siteInfo2.from = Convert.ToInt32(this.tb_Site2_Come_Add.Text.ToString()); siteInfo2.type = Convert.ToInt32(this.tb_Site2_Type_Add.Text.ToString()); siteInfo2.videoFormat = Convert.ToInt32(this.tb_Site2_VF_Add.Text.ToString()); siteInfo2.videoProtocol = Convert.ToInt32(this.tb_Site2_VP_Add.Text.ToString()); //向会议模板中添加会场 sites.Add(siteInfo1); sites.Add(siteInfo2); SiteInfoEx[] site = sites.ToArray(); adhocConfTemplate.sites = site; this.DialogResult = DialogResult.Yes; } catch (Exception error) { MessageBox.Show(error.ToString()); } }
public override string ToString() { if (tempClass != null) { if (typeof(T) == typeof(ConferenceInfoEx)) { ConferenceInfoEx temp = (ConferenceInfoEx)tempClass; if (temp.sites != null && temp.beginTime != null) { StringBuilder buffer = new StringBuilder(); buffer.Append("("); for (int i = 0; i < temp.sites.Length; i++) { buffer.Append("name = " + temp.sites[i].name + "," + "uri = " + temp.sites[i].uri); if (i < temp.sites.Length - 1) { buffer.Append(";"); } } buffer.Append(")"); return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + ",beginTime = " + temp.beginTime.ToString() + ",sites = " + buffer.ToString() + "}"); } return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + ",sites = null" + "}"); } else if (typeof(T) == typeof(RecurrenceConfInfoEx)) { RecurrenceConfInfoEx temp = (RecurrenceConfInfoEx)tempClass; return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + "}"); } else if (typeof(T) == typeof(ConferenceStatusEx)) { ConferenceStatusEx temp = (ConferenceStatusEx)tempClass; return("{confId = " + temp.id + ",Name = " + temp.name + ",Status = " + temp.status + ",beginTime = " + temp.beginTime + "}"); } else if (typeof(T) == typeof(SiteStatusEx)) { SiteStatusEx temp = (SiteStatusEx)tempClass; return("{siteUri = " + temp.uri + ",Name = " + temp.name + ",Status = " + temp.status + "}"); } else if (typeof(T) == typeof(SiteAccessInfoEx)) { SiteAccessInfoEx temp = (SiteAccessInfoEx)tempClass; return("{siteUri = " + temp.uri + ",Name = " + temp.name + ",confaccessCode = " + temp.confAccessCode + "}"); } else if (typeof(T) == typeof(SiteMCUEx)) { SiteMCUEx temp = (SiteMCUEx)tempClass; return("{siteUri = " + temp.siteUri + ",mcuId = " + temp.mcuId + "}"); } else if (typeof(T) == typeof(AdhocConfFreeBusyStateEx)) { AdhocConfFreeBusyStateEx temp = (AdhocConfFreeBusyStateEx)tempClass; StringBuilder buffer = new StringBuilder(); buffer.Append("("); for (int i = 0; i < temp.freebusys.Length; i++) { buffer.Append("confId = " + temp.freebusys[i].confId + "," + "state = " + temp.freebusys[i].state); if (i < temp.freebusys.Length - 1) { buffer.Append(";"); } } buffer.Append(")"); return("{confAccessCode = " + temp.confAccessCode + ",freebusys = " + buffer.ToString() + "}"); } else if (typeof(T) == typeof(AdhocConferenceEx)) { AdhocConferenceEx temp = (AdhocConferenceEx)tempClass; return("{Name = " + temp.name + ",confaccessCode = " + temp.confAccessCode + "}"); } else if (typeof(T) == typeof(AdhocConfTemplateParamEx)) { AdhocConfTemplateParamEx temp = (AdhocConfTemplateParamEx)tempClass; return("{Name = " + temp.name + ",adhocConfTemplateId = " + temp.adhocConfTemplateId + ",accessCode = " + temp.accessCode + "}"); } else if (typeof(T) == typeof(MultiPointCDREx)) { MultiPointCDREx temp = (MultiPointCDREx)tempClass; return("{siteName = " + temp.siteName + ",siteUri = " + temp.siteUri + ",siteType = " + temp.siteType.ToString() + ",conferenceName = " + temp.conferenceName + ",conferenceId = " + temp.conferenceId + "}"); } else if (typeof(T) == typeof(PointToPointCDREx)) { PointToPointCDREx temp = (PointToPointCDREx)tempClass; return("{callingUri = " + temp.callingUri + ",calledUri = " + temp.calledUri + "}"); } else if (typeof(T) == typeof(NotificationEx)) { NotificationEx temp = (NotificationEx)tempClass; return("{" + "}"); } else if (typeof(T) == typeof(TerminalInfoEx)) { TerminalInfoEx temp = (TerminalInfoEx)tempClass; return("{siteName = " + temp.name + ",siteUri = " + temp.uri + ",siteType = " + temp.type.ToString() + "}"); } else if (typeof(T) == typeof(SiteInfoEx)) { SiteInfoEx temp = (SiteInfoEx)tempClass; return("{siteName = " + temp.name + ",siteUri = " + temp.uri + ",siteType = " + temp.type.ToString() + "}"); } else if (typeof(T) == typeof(OrganizationItemEx)) { OrganizationItemEx temp = (OrganizationItemEx)tempClass; return("{Name = " + temp.name + ",id = " + temp.id + "}"); } else if (typeof(T) == typeof(MCUResourceEx)) { MCUResourceEx temp = (MCUResourceEx)tempClass; MCUResourceItemEx[] temp1 = temp.resourceList; StringBuilder buffer1 = new StringBuilder(); StringBuilder buffer2 = new StringBuilder(); buffer1.Append("("); for (int i = 0; i < temp1.Length; i++) { ResourceOccupiedStatusEx[] temp2 = temp1[i].resourceStatus; buffer1.Append(temp1[i].resourceType.ToString()); buffer2.Append("("); for (int j = 0; j < temp2.Length; j++) { ResourceOccupiedStatusEx temp3 = temp2[i]; buffer2.Append("freeCount = " + temp3.freeCount + ",totalCount = " + temp3.totalCount); if (i < temp2.Length - 1) { buffer2.Append(";"); } } if (i < temp1.Length - 1) { buffer1.Append(";"); } } buffer1.Append(")"); buffer2.Append(")"); return("{mcuId = " + temp.mcuId + ",resourceType = " + buffer1.ToString() + ",Count = " + buffer2.ToString() + "}"); } else if (typeof(T) == typeof(MCUInfoEx)) { MCUInfoEx temp = (MCUInfoEx)tempClass; return("{mucName = " + temp.name + ",mcuId = " + temp.id + "}"); } else { return("No this class type !"); } } return("object is null!"); }