Beispiel #1
0
        /// <summary>
        /// 加载内容完成事件
        /// </summary>
        void ContentAddCompleateEvent(string title)
        {
            try
            {
                //已经处于资源共享页面则不进行闪烁
                if (Conference.MainWindow.MainPageInstance.ViewSelectedItemEnum != ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource)
                {
                    //资源共享导航按钮闪烁
                    Conference.MainWindow.MainPageInstance.ResourceReceivMessageFlash();
                }

                //this.ConversationM.tabItem1.Header = title;

                //投影到大屏幕
                LyncHelper.InviteSomeOneJoinMainConference(Constant.lyncClient, LyncHelper.MainConversation, Constant.BigScreenName);
                //强制导航到资源共享
                this.ForceToNavicate(ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource);
                this.ConversationM.PageIndex = ResourceType.Share;
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Beispiel #2
0
 /// <summary>
 /// 投影大屏幕
 /// </summary>
 /// <param name="args">通讯基础数据包</param>
 private void Lync_BigScreenEnter(C_BaseData args)
 {
     try
     {
         //大屏实体
         lync_webData.BigScreenEnterEntity bigScreenEnterEntity = args.LyncConversationFlg.BigScreenEnterEntity;
         //更改状态
         MainWindow.mainWindow.mainPage.SharingPanel.UpdateState(bigScreenEnterEntity.Sharer);
         //显示投影人
         MainPage.mainPage.presentCallBack(bigScreenEnterEntity.Sharer);
         //判断大屏投影人是否为当前参会人
         if (!bigScreenEnterEntity.Sharer.Equals(Constant.SelfName))
         {
             //强制导航到资源共享
             MainPage.mainPage.ForceToNavicate(view_Selected.Resource);
             //共享协作页面
             this.ConversationM.PageIndex = ResourceType.Share;
             //进行最大化显示
             if (MainWindow.mainWindow.WindowState == WindowState.Minimized)
             {
                 MainWindow.mainWindow.WindowState = WindowState.Maximized;
             }
             //设置会话区域显示内容
             this.ConversationM.SetConversationAreaShow(ShowType.ConversationView, true);
         }
         else if (bigScreenEnterEntity.Sharer.Equals(Constant.SelfName))
         {
             //加载大屏幕
             LyncHelper.InviteSomeOneJoinMainConference(Constant.lyncClient, LyncHelper.MainConversation, Constant.BigScreenName);
             //设置会话区域显示内容
             this.ConversationM.SetConversationAreaShow(ShowType.SelfDeskTopShowView, true);
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
Beispiel #3
0
 /// <summary>
 /// 加载内容完成事件
 /// </summary>
 /// <param name="title">加载共享内容标题</param>
 void contentAddCompleateCallBack(string title)
 {
     try
     {
         //已经处于资源共享页面则不进行闪烁
         if (MainPage.mainPage.ViewSelectedItemEnum != ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource)
         {
             //资源共享导航按钮闪烁
             MainPage.mainPage.ResourceReceivMessageFlash();
         }
         //投影到大屏幕
         LyncHelper.InviteSomeOneJoinMainConference(Constant.lyncClient, LyncHelper.MainConversation, Constant.BigScreenName);
         //资源共享页面
         this.ConversationM.PageIndex = ResourceType.Share;
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
Beispiel #4
0
        /// <summary>
        /// lync同步辅助
        /// </summary>
        /// <param name="args"></param>
        void LyncConversationSyncHelper(ConferenceWebCommon.Common.PackageBase args)
        {
            try
            {
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    try
                    {
                        switch (args.LyncConversationFlg.LyncConversationFlgType)
                        {
                        case ConferenceWebCommon.EntityHelper.LyncConversation.LyncConversationFlgType.InviteContact:
                            //获取信息同步映射实体数据
                            ConferenceWebCommon.EntityHelper.LyncConversation.LyncConversationEntity conferenceInfoEntity = args.LyncConversationFlg.LyncConversationEntity;
                            //邀请某人进入会话
                            //lyncEventManage.InviteSomeOneJoinMainConference(Constant.lyncClient, MainConversation, conferenceInfoEntity.JonConferencePerson);
                            break;

                        case ConferenceWebCommon.EntityHelper.LyncConversation.LyncConversationFlgType.EnterBigScreen:
                            ConferenceWebCommon.EntityHelper.LyncConversation.BigScreenEnterEntity bigScreenEnterEntity = args.LyncConversationFlg.BigScreenEnterEntity;

                            //更改状态
                            MainWindow.mainWindow.mainPage.SharingPanel.UpdateState(bigScreenEnterEntity.Sharer);
                            //显示投影人
                            MainWindow.MainPageInstance.GetPresenterCallBack(bigScreenEnterEntity.Sharer);

                            if (!bigScreenEnterEntity.Sharer.Equals(Constant.SelfName))
                            {
                                //强制导航到资源共享
                                MainWindow.MainPageInstance.ForceToNavicate(ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource);

                                this.ConversationM.PageIndex = ResourceType.Share;
                                if (MainWindow.mainWindow.WindowState == WindowState.Minimized)
                                {
                                    MainWindow.mainWindow.WindowState = WindowState.Maximized;
                                }

                                //设置会话区域显示内容
                                this.ConversationM.SetConversationAreaShow(ShowType.ConversationView, true);
                            }
                            else if (bigScreenEnterEntity.Sharer.Equals(Constant.SelfName))
                            {
                                //加载大屏幕
                                LyncHelper.InviteSomeOneJoinMainConference(Constant.lyncClient, LyncHelper.MainConversation, Constant.BigScreenName);
                                //设置会话区域显示内容
                                this.ConversationM.SetConversationAreaShow(ShowType.SelfDeskTopShowView, true);
                            }
                            break;

                        case ConferenceWebCommon.EntityHelper.LyncConversation.LyncConversationFlgType.PPTControl:

                            if (args.LyncConversationFlg.PPTControlEntity.Controler.Equals(Constant.LoginUserName))
                            {
                                if (ViewSelectedItemEnum == ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource)
                                {
                                    if (this.ConversationM.PageIndex == ResourceType.Share)
                                    {
                                        //模仿鼠标点击
                                        Win32API.SetCursorPos(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2, System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2);
                                        Win32API.mouse_event(Win32API.MouseEventFlag.LeftDown, 0, 0, 0, UIntPtr.Zero);
                                        Win32API.mouse_event(Win32API.MouseEventFlag.LeftUp, 0, 0, 0, UIntPtr.Zero);
                                    }
                                }
                            }

                            break;

                            #region old solution

                            //if (MainWindow.MainPageInstance.TempConferenceInformationEntity.RunCKOAPP)
                            //{
                            //    if (bigScreenEnterEntity.Sharer.Equals(Constant.SelfUri))
                            //    {
                            //        #region old solution

                            //        //主窗体最小化
                            //        MainWindow.mainWindow.WindowState = WindowState.Minimized;
                            //        Process[] processList = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Constant.CkoAirFileName));

                            //        if (processList.Count() > 0)
                            //        {
                            //            System.Windows.Forms.SendKeys.SendWait("^+{f}");
                            //        }
                            //        else
                            //        {
                            //            this.CKOIsRuning = true;
                            //            ProcessManage.OpenFileByLocalAddress(Environment.CurrentDirectory + "\\" + Constant.CkoAirFileName);
                            //        }

                            //        #endregion

                            //        #region old solution

                            //        //if (!this.CKOIsRuning)
                            //        //{
                            //        //    this.CKOIsRuning = true;
                            //        //    ProcessManage.OpenFileByLocalAddress(Environment.CurrentDirectory + "\\" + Constant.CkoAirFileName);
                            //        //    //TimerJob.StartRun(new Action(() =>
                            //        //    //    {
                            //        //    //        Process[] processList = Process.GetProcessesByName("CkoAir");
                            //        //    //        if (processList.Count() > 0 && processList[0].MainWindowHandle.ToInt32() > 0)
                            //        //    //        {
                            //        //    //            //获取当前会话窗体的句柄
                            //        //    //            IntPtr Handle = processList[0].MainWindowHandle;

                            //        //    //            ////获取会话窗体的状态
                            //        //    //            //Win32API.GetWindowPlacement(Handle, ref this.Placement2);
                            //        //    //            ////最小话窗体
                            //        //    //            //this.Placement2.showCmd =2;
                            //        //    //            //Win32API.SetWindowPlacement(Handle, ref this.Placement2);

                            //        //    //            var dd = WindowHide.GetHandleList(Handle.ToInt32());
                            //        //    //            var dd2 = WindowHide.GetHandleList(processList[0].Handle.ToInt32());

                            //        //    //            CkoManageTimer.Stop();
                            //        //    //        }
                            //        //    //    }), 100, out CkoManageTimer);
                            //        //}
                            //        //else
                            //        //{
                            //        //    System.Windows.Forms.SendKeys.SendWait("^+{f}");
                            //        //}

                            //        #endregion
                            //    }
                            //    else
                            //    {
                            //        //TimerJob.StartRun(new Action(() =>
                            //        //   {
                            //        //System.Windows.Forms.SendKeys.SendWait("^+{s}");
                            //        //}));
                            //        //主窗体最小化
                            //        MainWindow.mainWindow.WindowState = WindowState.Maximized;
                            //    }
                            //}

                            #endregion


                        case ConferenceWebCommon.EntityHelper.LyncConversation.LyncConversationFlgType.LeaveConversation:
                            if (LyncHelper.MainConversation != null)
                            {
                                ConferenceWebCommon.EntityHelper.LyncConversation.LeaveConversationEntity leaveConversationEntity = args.LyncConversationFlg.LeaveConversationEntity;
                                string contactUri = leaveConversationEntity.ContactUri;

                                foreach (var item in LyncHelper.MainConversation.Conversation.Participants)
                                {
                                    if (item.Contact.Uri.Equals("sip:" + contactUri))
                                    {
                                        LyncHelper.MainConversation.Conversation.RemoveParticipant(item);
                                        break;
                                    }
                                }
                            }
                            break;

                        default:
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManage.WriteLog(this.GetType(), ex);
                    }
                    finally
                    {
                    }
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
        }