Beispiel #1
0
        /// <summary>
        /// 更改一个座位信息(自己或其他参会人)
        /// </summary>
        public void UpdateOneSeat(webCommonMaxtrix.SeatEntity seatEntity)
        {
            try
            {
                //座位数量统计
                int count = this.GridSeatPanel.Children.Count;

                if (this.selfSeatEntity != null)
                {
                    int number = seatEntity.SettingNummber;
                    if (this.selfSeatEntity.SettingNummber <= count / 2)
                    {
                        if (number <= count / 2)
                        {
                            this.dicSeatButton1[number].Content = seatEntity.UserName;
                        }
                        else
                        {
                            this.dicSeatButton2[number].Content = seatEntity.UserName;
                        }
                    }
                    else
                    {
                        if (number <= count / 2)
                        {
                            //座位对应名称设置
                            this.dicSeatButton2[number + count / 2].Content = seatEntity.UserName;
                        }
                        else
                        {
                            //座位对应名称设置
                            this.dicSeatButton1[number - count / 2].Content = seatEntity.UserName;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Beispiel #2
0
        public List <SeatEntity> InToOneSeat(int conferenceID, string seatList, string selfUri, string selfName, string selfIP)
        {
            lock (objInToOneSeat)
            {
                //座位信息集合
                List <SeatEntity> settingList = null;
                try
                {
                    if (conferenceID != 0)
                    {
                        //座位加载人
                        SeatEntity settingAddEntity = null;
                        //座位信息
                        if (!dicSeatEntity.ContainsKey(conferenceID))
                        {
                            //座位信息集合
                            settingList = new List <SeatEntity>();

                            //分割获取座位IP集
                            string[] settingIpList = seatList.Split(new char[] { '*' });

                            //加载位置信息
                            for (int i = 0; i < settingIpList.Count(); i++)
                            {
                                //创建一个座位实体
                                SeatEntity settingEntity = new ConferenceWebCommon.EntityHelper.ConferenceMatrix.SeatEntity();
                                //设置座位IP
                                settingEntity.SettingIP = settingIpList[i];
                                //设置座位序列号
                                settingEntity.SettingNummber = i + 1;
                                //添加座位实体
                                settingList.Add(settingEntity);

                                //设置当前用户名称
                                if (selfIP.Equals(settingIpList[i]))
                                {
                                    settingEntity.UserName     = selfName;
                                    settingAddEntity           = settingEntity;
                                    settingAddEntity.SharerUri = selfUri;
                                }
                            }
                            //针对会议的座位信息
                            dicSeatEntity.Add(conferenceID, settingList);
                        }
                        else
                        {
                            List <SeatEntity> sList = dicSeatEntity[conferenceID];
                            //加载位置信息
                            for (int i = 0; i < sList.Count(); i++)
                            {
                                //设置当前用户名称
                                if (selfIP.Equals(sList[i].SettingIP))
                                {
                                    settingAddEntity           = sList[i];
                                    settingAddEntity.SharerUri = selfUri;
                                    sList[i].UserName          = selfName;
                                    break;
                                }
                            }
                            //获取当前会议的座位信息
                            settingList = dicSeatEntity[conferenceID];
                        }

                        //实时同步(发送信息给客户端)
                        this.InformClient(conferenceID, settingAddEntity);
                    }
                }
                catch (Exception ex)
                {
                    LogManage.WriteLog(this.GetType(), ex);
                }
                finally
                {
                }
                return(settingList);
            }
        }