Exemple #1
0
        private void OK_Button_Click(object sender, EventArgs e)
        {
            try
            {
                //准备将会场添加到的组织节点ID中
                this.orgId = this.tb_orgId.Text.ToString();
                //准备添加的会场数据
                this.siteInfo = new TerminalInfoEx();
                //会场名称
                siteInfo.name = this.tb_Site1_Name.Text.ToString();
                //会场标识
                siteInfo.uri = this.tb_Site1_URI.Text.ToString();
                //会场类型
                siteInfo.type = Convert.ToInt32(this.tb_Site1_Type.Text.ToString());
                //速率。格式为“速率值k/M”,如“1920k”。默认由系统自动选择
                siteInfo.rate = this.tb_Site1_Rate.Text.ToString();
                //(可选)H.323、SIP协议会场注册SC的用户名
                //siteInfo.regUser = "******";
                siteInfo.regUser = this.textBox1.Text.ToString();
                //(可选)H.323、SIP协议会场注册SC的密码
                //siteInfo.regPassword = "******";
                siteInfo.regPassword = this.textBox2.Text.ToString();
                //(可选)终端支持的视频能力参数列表。如果不填,则认为支持所有视频
                VideoCapbilityItemEx vc = new VideoCapbilityItemEx();
                int[] vf = { Convert.ToInt32(this.tb_Site1_VF.Text.ToString()) };
                //视频协议对应的视频格式列表
                vc.videoFormat = vf;
                //视频协议
                vc.videoProtocol = Convert.ToInt32(this.tb_Site1_VP.Text.ToString());
                VideoCapbilityItemEx[] videoCapbility = { vc };
                siteInfo.videoCapbility = videoCapbility;

                this.DialogResult = DialogResult.Yes;
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        }
Exemple #2
0
        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!");
        }