public void RoomItemForceToSelectedStyle(ConferenceInformationEntityPC conferenceInformationEntityPC) { try { foreach (var item in this.wrapPanle.Children) { if (item is ConferenceRoomItem) { ConferenceRoomItem conferenceRoomItem = item as ConferenceRoomItem; if (conferenceInformationEntityPC.MeetingName.Equals(conferenceRoomItem.ConferenceInformationEntity.MeetingName)) { //当前选择的会议聊天室 if (this.CurrentConferenceRoomItem != null) { this.CurrentConferenceRoomItem.StyleChangeToNoSelected(); } //临时存储的会议信息 MainWindow.MainPageInstance.TempConferenceInformationEntity = conferenceInformationEntityPC; this.CurrentConferenceRoomItem = conferenceRoomItem; this.CurrentConferenceRoomItem.StyleChangeToSelected(); } } } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 会议卡片加载 /// </summary> public void RoomCardInit(ConferenceRoomItem roomItem, ConferenceInformationEntityPC item) { try { if (this.ItemClickSendItemCallBack != null) { if (this.AddCardEventCallBack != null) { this.AddCardEventCallBack(); } //当前选择的会议聊天室 if (this.CurrentConferenceRoomItem != null) { this.CurrentConferenceRoomItem.StyleChangeToNoSelected(); } //临时存储的会议信息 MyConferenceCodeEnterEntity.TempConferenceInformationEntity = item; this.CurrentConferenceRoomItem = roomItem; this.CurrentConferenceRoomItem.StyleChangeToSelected(); MyConferenceView.myConferenceView.TipShow(true); //点击回调 this.ItemClickSendItemCallBack(item); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 判断当前用户是否为主持人(该标示在程序全局上使用) /// </summary> /// <param name="conferenceInformationEntity">会议信息实体</param> private static void PresentSetting(ConferenceInformationEntityPC conferenceInformationEntity) { try { //主持人邮箱 string applyPeople = conferenceInformationEntity.ApplyPeople; //判断当前用户是否为主持人(该标示在程序全局上使用) if (Constant.SelfUri.Equals(applyPeople) || Constant.SelfName.Equals(applyPeople)) { Constant.IsMeetingPresenter = true; } else { Constant.IsMeetingPresenter = false; } ////会议主持人 conferenceInformationEntity.ApplyPeople = LyncHelper.GetUserName(applyPeople); string state = LyncHelper.GetInformationAcording(applyPeople, ContactInformationType.Activity); string info = conferenceInformationEntity.ApplyPeople + "(" + state + ")"; MyConferenceView.myConferenceView.PresenterInfoSetting(info); } catch (Exception ex) { LogManage.WriteLog(typeof(MainPageBase), ex); } finally { } }
/// <summary> /// 填充全局字段(参会人列表、会议名称、会议ID) /// </summary> /// <param name="conferenceInformationEntity">会议信息实体</param> private void GlobalDataInit(ConferenceInformationEntityPC conferenceInformationEntity) { try { //参会人列表 Constant.ParticipantList = conferenceInformationEntity.JoinPeople.ToList <string>(); //参会名称 Constant.ConferenceName = conferenceInformationEntity.MeetingName; //会议室名称 Constant.ConferenceRoomName = conferenceInformationEntity.RoomName; //会议主持人 Constant.ConferenceHost = conferenceInformationEntity.ApplyPeople; //教育模式(确认,主页面顶部显示信息) MainPage.mainPage.ViewModelChangedEducation(conferenceInformationEntity.EducationMode); //参会ID Constant.MeetingID = conferenceInformationEntity.MeetingID; //网络浏览地址 Constant.WebUri = conferenceInformationEntity.WebUri; //显示参会名称 this.MeetingName = Constant.ConferenceName; //投影大屏幕 Constant.BigScreenName = conferenceInformationEntity.BigScreenName; } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 释放之前使用的通讯节点 /// </summary> /// <param name="conferenceInformationEntity">会议信息实体</param> private void DisPoseCommunicate(ConferenceInformationEntityPC conferenceInformationEntity) { try { //检测是否释放所有通讯节点 this.IsDisposeAllSocekt = false; ThreadPool.QueueUserWorkItem((o) => { //释放之前使用的通讯节点 this.DisPoseServerSocketArray(conferenceInformationEntity.MeetingName, new Action <bool>((isCompleate) => { if (isCompleate) { //检测是否释放所有通讯节点 this.IsDisposeAllSocekt = true; } })); }); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 会议进入事件 /// </summary> /// <param name="conferenceInformationEntity">会议信息数据实体</param> protected void ItemClick_DisposeSourceAndInitAgain(ConferenceInformationEntityPC conferenceInformationEntity) { try { if (conferenceInformationEntity != null) { //临时存储的会议信息 Constant.TempConferenceInformationEntity = conferenceInformationEntity; //模式确定 MainPage.mainPage.IsSimpleModel(); //模式确定 MainPage.mainPage.IsEdacationModel(); //模式确定 MainPage.mainPage.IsNormalModel(); //释放相关资源 this.DisposeAllResource(); //释放之前使用的通讯节点 this.DisPoseCommunicate(conferenceInformationEntity); //全局信息填充及初始化 this.GlobleInfoLoadAndInit(conferenceInformationEntity); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 加入当前参与的一个会议 /// </summary> protected void JoinConfereince(Action action) { try { this.ConferenceRoom_View.ConferenceRoomFlesh(new Action(() => { //会议开始时间和当前时间的间距 double timeSpace = 0; //遍历所有会议信息(获取最接近当前时间的会议) foreach (var item in this.ConferenceRoom_View.ConferenceInformationEntityList) { if (item.BeginTime < DateTime.Now.AddMinutes(-30)) { //获取当前会议开始时间与当前时间的时间差 var timeSpace1 = (DateTime.Now - item.BeginTime).TotalSeconds; if (timeSpace == 0 && item.JoinPeople.Contains(Constant.SelfUri)) { timeSpace = timeSpace1; TempConferenceInformationEntity = item; } //将更接近当前时间的会议做一个标示 else if (timeSpace1 < timeSpace && item.JoinPeople.Contains(Constant.SelfUri)) { timeSpace = timeSpace1; //设置为临时存储的会议 TempConferenceInformationEntity = item; } } } MainWindow.MainPageInstance.MyConferenceView.TipShow(true); //会议进入事件 this.conferenceRoom_View_ItemClick(TempConferenceInformationEntity, new Action(() => { //调用回调事件 action(); MainWindow.MainPageInstance.MyConferenceView.TipShow(false); //填充参会人信息 MainWindow.MainPageInstance.MyConferenceView.FillDataSource(); //强制更改样式 MainWindow.MainPageInstance.ConferenceRoom_View.RoomItemForceToSelectedStyle(TempConferenceInformationEntity); })); })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
public ConferenceRoomItem(ConferenceInformationEntityPC conferenceInformationEntity) : this() { try { //绑定当前上下文 this.DataContext = conferenceInformationEntity; ConferenceInformationEntity = conferenceInformationEntity; if (conferenceInformationEntity.EndTime > DateTime.Now) { this.borImg.Background = Application.Current.Resources["brush_Room2"] as ImageBrush; } else { this.borImg.Background = Application.Current.Resources["brush_Room"] as ImageBrush; } //鼠标进入启动动画 this.MouseEnter += ConferenceRoomItem_MouseEnter; //鼠标移除启动反向动画 this.MouseLeave += ConferenceRoomItem_MouseLeave; #region 注册事件 //图例点击 this.MouseLeftButtonDown += ConferenceRoomItem_MouseLeftButtonDown; #endregion DispatcherTimer timer = null; TimerJob.StartRun(new Action(() => { if (Constant.DicParticipant.Count > 0) { //参会人绑定 if (conferenceInformationEntity.ApplyPeople != null && Constant.DicParticipant.ContainsKey(conferenceInformationEntity.ApplyPeople)) { conferenceInformationEntity.ApplyPeople = Constant.DicParticipant[conferenceInformationEntity.ApplyPeople]; } timer.Stop(); } }), 600, out timer); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 全局信息填充及初始化 /// </summary> /// <param name="conferenceInformationEntity">会议信息数据实体</param> /// <param name="callBack"></param> private void GlobleInfoLoadAndInit(ConferenceInformationEntityPC conferenceInformationEntity) { try { TimerJob.StartRun(new Action(() => { if (this.IsDisposeAllSocekt) { if (this.CheckDisposeAllSocketTimer != null) { this.CheckDisposeAllSocketTimer.Stop(); } //模式管理中心 this.Model_ManageCenter(conferenceInformationEntity.EducationMode, conferenceInformationEntity.SimpleMode); //填充全局字段(参会人列表、会议名称、会议ID) this.GlobalDataInit(conferenceInformationEntity); //会话标示服务器判断移除 ModelManage.ConferenceLyncConversation.RemoveConversation(Constant.ConferenceName, new Action <bool>((successed) => { if (successed) { this.canBeginLyncConversationInit = true; } })); //判断是否为会议主持人(是的话设置全局标示) MainPageBase.PresentSetting(conferenceInformationEntity); //共享协作数据准备 this.ConversationDataInitPrepare(); //填充参会人信息 LyncHelper.AddContacts(); //重新进行会话配置 this.Conversation_Configure(); } }), 800, out this.CheckDisposeAllSocketTimer); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
public ConferenceRoomItem(ConferenceInformationEntityPC conferenceInformationEntity) : this() { try { //绑定当前上下文 this.DataContext = conferenceInformationEntity; conferenceInformationEntityPC = conferenceInformationEntity; if (conferenceInformationEntity.EndTime > DateTime.Now) { this.borImg.Background = this.Resources["brush_Room2"] as ImageBrush; } else { this.borImg.Background = this.Resources["brush_Room"] as ImageBrush; } //鼠标进入启动动画 this.MouseEnter += ConferenceRoomItem_MouseEnter; //鼠标移除启动反向动画 this.MouseLeave += ConferenceRoomItem_MouseLeave; #region 注册事件 //图例点击 this.MouseLeftButtonDown += ConferenceRoomItem_MouseLeftButtonDown; #endregion if (this.SettingMeetPrensterCallBack != null) { this.SettingMeetPrensterCallBack(conferenceInformationEntity); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 全局信息填充及初始化 /// </summary> /// <param name="conferenceInformationEntity"></param> /// <param name="callBack"></param> private void GlobleInfoLoadAndInit(ConferenceInformationEntityPC conferenceInformationEntity, Action callBack) { try { TimerJob.StartRun(new Action(() => { if (this.IsDisposeAllSocekt) { if (this.CheckDisposeAllSocketTimer != null) { this.CheckDisposeAllSocketTimer.Stop(); } #region 填充全局字段(参会人列表、会议名称、会议ID) //参会人列表 Constant.ParticipantList = conferenceInformationEntity.JoinPeople.ToList <string>(); //参会名称 Constant.ConferenceName = conferenceInformationEntity.MeetingName; //会议室名称 Constant.ConferenceRoomName = conferenceInformationEntity.RoomName; //会议主持人 Constant.ConferenceHost = conferenceInformationEntity.ApplyPeople; if (conferenceInformationEntity.EducationMode) { //主窗体标题2显示 MainWindow.mainWindow.MainWindowHeader2 = Constant.EducationTittle1 + Constant.ConferenceName; //设置主窗体标题2 MainWindow.mainWindow.MainWindowHeader3 = " " + Constant.EducationTittle2 + Constant.SelfName; } else { //主窗体标题2显示 MainWindow.mainWindow.MainWindowHeader2 = Constant.DiscussTittle1 + Constant.ConferenceName; //设置主窗体标题2 MainWindow.mainWindow.MainWindowHeader3 = " " + Constant.DiscussTittle2 + Constant.SelfName; } //参会ID Constant.MeetingID = conferenceInformationEntity.MeetingID; //网络浏览地址 Constant.WebUri = conferenceInformationEntity.WebUri; //显示参会名称 this.MeetingName = Constant.ConferenceName; //投影大屏幕 Constant.BigScreenName = conferenceInformationEntity.BigScreenName; #endregion #region 会话标示服务器判断移除 ModelManage.ConferenceLyncConversation.RemoveConversation(Constant.ConferenceName, new Action <bool>((successed) => { if (successed) { this.canBeginLyncConversationInit = true; } })); #endregion #region 判断是否为会议主持人(是的话设置全局标示,服务器应用池持续性设置) //判断当前用户是否为主持人(该标示在程序全局上使用) if (Constant.SelfUri.Equals(conferenceInformationEntity.ApplyPeople) || Constant.SelfName.Equals(conferenceInformationEntity.ApplyPeople)) { Constant.IsMeetingPresenter = true; } else { Constant.IsMeetingPresenter = false; } #endregion //填充参会人信息 LyncHelper.AddContacts(); #region 获取服务端口 //获取服务端口 this.GetServicePort(callBack); #endregion #region 重新进行会话配置 TimerJob.StartRun(new Action(() => { if (this.canBeginLyncConversationInit) { this.CheckConversationInitTimer.Stop(); //会话初始化 this.LyncConversationInit(); } }), 1000, out this.CheckConversationInitTimer); #endregion } }), 800, out this.CheckDisposeAllSocketTimer); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 会议进入事件 /// </summary> /// <param name="conferenceInformationEntity"></param> protected void conferenceRoom_View_ItemClick(ConferenceInformationEntityPC conferenceInformationEntity, Action callBack) { try { if (conferenceInformationEntity != null) { #region 是否为教学模式 if (conferenceInformationEntity.EducationMode) { if (this.ViewModelChangedEducationEvent != null) { this.ViewModelChangedEducationEvent(true); } } else { if (this.ViewModelChangedEducationEvent != null) { this.ViewModelChangedEducationEvent(false); } } #endregion #region 是否为精简模式 if (conferenceInformationEntity.SimpleMode) { if (this.ViewModelChangedSimpleEvent != null) { this.ViewModelChangedSimpleEvent(true); } } else { if (this.ViewModelChangedSimpleEvent != null) { this.ViewModelChangedSimpleEvent(false); } } #endregion #region 释放相关资源(本地套接字、研讨会) //设置为不可进行会话初始化 this.canBeginLyncConversationInit = false; //停止保持服务器web服务持续激活(之前使用的) //this.CloseWebServiceAppPoolAliveHelper(); //参会人信息清空 Constant.DicParticipant.Clear(); //离开坐席 //ChairView.LeaveSeat(); //离开坐席 MyConferenceView.LeaveSeat(); //释放资源 this.UIAndSourceDispose(); //检测是否可以会话初始化计时数量置零 this.CheckConversationInitCount = 0; //还原默认设置 this.ConversationM.CurrentShowType = ShowType.None; this.ConversationM.IsCanNavicateConversationView = false; #endregion #region 释放之前使用的通讯节点 this.IsDisposeAllSocekt = false; ThreadPool.QueueUserWorkItem((o) => { //释放之前使用的通讯节点 this.DisPoseServerSocketArray(conferenceInformationEntity.MeetingName, new Action <bool>((isCompleate) => { if (isCompleate) { this.IsDisposeAllSocekt = true; } })); }); #endregion //全局信息填充及初始化 GlobleInfoLoadAndInit(conferenceInformationEntity, callBack); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 会议卡片加载 /// </summary> public void RoomCardInit(ConferenceRoomItem roomItem, ConferenceInformationEntityPC item) { try { if (this.ItemClickCallBackToMainPage != null) { #region old solution //if(Constant.lyncClient.ConversationManager.Conversations.Count>0) //{ // Constant.lyncClient.ConversationManager.Conversations.Clear(); //} #endregion //离开会话 if (LyncHelper.MainConversation != null) { //离开当前会话 //LyncHelper.MainConversation.Close(); LyncHelper.MainConversation.Close(); foreach (var conversation in Constant.lyncClient.ConversationManager.Conversations) { ConversationWindow window = Constant.lyncAutomation.GetConversationWindow(conversation); window.Close(); } ModelManage.ConferenceLyncConversation.LeaveConversation(Constant.ConferenceName, Constant.SelfUri, new Action <bool>((isSuccessed) => { })); LyncHelper.MainConversation = null; } //当前选择的会议聊天室 if (this.CurrentConferenceRoomItem != null) { this.CurrentConferenceRoomItem.StyleChangeToNoSelected(); } //临时存储的会议信息 MainWindow.MainPageInstance.TempConferenceInformationEntity = item; this.CurrentConferenceRoomItem = roomItem; this.CurrentConferenceRoomItem.StyleChangeToSelected(); MainWindow.MainPageInstance.MyConferenceView.TipShow(true); //点击回调 this.ItemClickCallBackToMainPage(item, new Action(() => { //刷新数据 MainWindow.MainPageInstance.MyConferenceView.FillDataSource(); MainWindow.MainPageInstance.MyConferenceView.TipShow(false); })); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }