コード例 #1
0
        /// <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
            {
            }
        }
コード例 #2
0
        /// <summary>
        /// 加载会话窗体
        /// </summary>
        /// <param name="window">指定窗体</param>
        public void DockConversationWindow(LyncClient lyncClient, ConversationWindow window)
        {
            try
            {
                Application.Current.MainWindow.Dispatcher.BeginInvoke(new Action(() =>
                {
                    try
                    {
                        if (!window.IsDocked)
                        {
                            //获取工作区域的宽度
                            int borWidth = MainWindow.MainPageInstance.GetWorkingArea_Width();
                            //获取工作区域的高度
                            int borHeight = Conference.MainWindow.MainPageInstance.GetWorkingArea_Height();

                            WindowsFormsHost host            = this.conversationHost.winHost;
                            System.Windows.Forms.Panel panel = this.conversationHost.panel;
                            host.Width  = panel.Width = borWidth - 110;
                            host.Height = panel.Height = borHeight - 30;
                            LyncHelper.DockToNewParentWindow(panel.Handle, this.DockInit);
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManage.WriteLog(this.GetType(), ex);
                    };
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
        }
コード例 #3
0
 /// <summary>
 /// 加载常规参数
 /// </summary>
 public void CommonParameter_Load()
 {
     try
     {
         //设置为不可见(上传提示)
         this.txtUPloadTip.Visibility = System.Windows.Visibility.Collapsed;
         //当前用户头像设置
         this.imgPerson.Source = new BitmapImage(new Uri(Constant.TreeServiceAddressFront + Constant.FtpServercePersonImgName + Constant.LoginUserName + ".png", UriKind.RelativeOrAbsolute));
         //当前用户名称显示
         this.txtSelfName.Text = Constant.SelfName;
         //当前用户公司
         Constant.SelfCompony = LyncHelper.GetInformationAcording(Constant.lyncClient.Self.Contact, ContactInformationType.Company);
         //当前用户职位
         Constant.SelfPosition = LyncHelper.GetInformationAcording(Constant.lyncClient.Self.Contact, ContactInformationType.Title);
         //当前用户公司名称显示
         this.txtCompony.Text = Constant.SelfCompony;
         //当前用户职位显示
         this.txtPosition.Text = Constant.SelfPosition;
         if (Constant.IsMeetingPresenter)
         {
             //显示模式切换面板
             this.gridModelChangedPanel.Visibility = System.Windows.Visibility.Visible;
             //显示客户端命令控制面板
             this.gridClientControlPanel.Visibility = System.Windows.Visibility.Visible;
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
 }
コード例 #4
0
 /// <summary>
 /// ppt共享
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnPPT_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (LyncHelper.MainConversation != null)
         {
             //打开选项对话框
             OpenFileDialog dialog = new OpenFileDialog();
             //指定显示的文件类型
             dialog.Filter = "PPT文件(*.ppt,*.pptx)|*.ppt;*.pptx;";
             //设置为多选
             dialog.Multiselect = false;
             if (dialog.ShowDialog() == true)
             {
                 //共享前释放资源
                 this.ShareBeforeDisposeResrouce();
                 //打开ppt共享辅助
                 LyncHelper.PPtShareHelper(dialog.FileName);
             }
         }
         else
         {
             MessageBox.Show("共享ppt之前先选择一个会话", "操作提示", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #5
0
        public bool SetConversationArea_Conversation2()
        {
            bool isChanged = false;

            try
            {
                if (this.isCanNavicateConversationView)
                {
                    if (LyncHelper.MainConversation != null && LyncHelper.MainConversation.State == ConversationWindowState.Initialized && LyncHelper.MainConversation.IsDocked)
                    {
                        this.borConversation.Child = null;
                        this.borConversation.Child = this.conversationHost;

                        LyncHelper.ShowWindowContent();
                        LyncHelper.FullScreen();

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
            return(isChanged);
        }
コード例 #6
0
        /// <summary>
        /// 填充参会人列表
        /// </summary>
        public void FillDataSource()
        {
            try
            {
                //会议名称
                this.ConferenceName = Constant.ConferenceName;

                //会议地址
                this.ConferenceRoomName = Constant.ConferenceRoomName;


                if (Constant.DicParticipant.ContainsKey(Constant.ConferenceHost))
                {
                    //会议主持人
                    this.ConferenceHost = Constant.DicParticipant[Constant.ConferenceHost];
                }
                //填充参会人列表
                LyncHelper.FillLyncOnlineInfo(this.datagrid, this.ParticipantsEntityList);
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #7
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
            {
            }
        }
コード例 #8
0
        /// <summary>
        /// 修复会话
        /// </summary>
        private void RepairConversationCallBack()
        {
            try
            {
                if (!string.IsNullOrEmpty(this.meetAddress))
                {
                    MainWindow.mainWindow.Topmost = true;
                    TimerJob.StartRun(new Action(() =>
                    {
                        //取消置顶
                        MainWindow.mainWindow.Topmost = false;
                    }), 2000);
                    LyncHelper.CloseAllConversation(new Action(() =>
                    {
                    }));

                    LyncHelper.JoinConversationByWebBrowser(this.meetAddress);
                    //释放dns(改为自由获取),主窗体状态还原(非置顶)
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #9
0
        /// <summary>
        /// lync程序环境设置(事件、状态、原生态界面抑制、注册表、标示)
        /// </summary>
        private void LyncEnviromentPrepare()
        {
            try
            {
                //初始化加载
                LyncHelper.SetLyncAplicationEnviroment(new Action(() =>
                {
                    if (this.Topmost == true || this.LoginPanelIsEnable == false)
                    {
                        //设置主窗体为最顶层
                        this.Topmost = false;

                        //登陆编辑区域恢复可用状态
                        this.LoginButtonIsEnable();
                    }
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #10
0
        /// <summary>
        /// 文件共享回调
        /// </summary>
        /// <param name="fileName">共享文件名称</param>
        private void FileShareCallBack(string fileName, wpfHelperFileType fileType)
        {
            try
            {
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    if (fileType == wpfHelperFileType.pptx || fileType == wpfHelperFileType.ppt)
                    {
                        //指定ppt进行共享
                        LyncHelper.PPtShareHelper(fileName);
                    }
                    else
                    {
                        //打开本地文件
                        this.ConversationM.OpenLocalFileHelper(fileName);

                        //设置会话区域显示内容
                        this.ConversationM.SetConversationAreaShow(ShowType.SelfDeskTopShowView, true);
                    }
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #11
0
        /// <summary>
        /// 加载会话窗体
        /// </summary>
        /// <param name="window">指定窗体</param>
        public void DockConversationWindow(LyncClient lyncClient, ConversationWindow window)
        {
            try
            {
                Application.Current.MainWindow.Dispatcher.BeginInvoke(new Action(() =>
                {
                    try
                    {
                        if (!window.IsDocked)
                        {
                            if (this.DockConversationWindowCallBack != null)
                            {
                                this.DockConversationWindowCallBack(new Action <int, int>((width, height) =>
                                {
                                    //获取工作区域的宽度
                                    int borWidth = width;
                                    //获取工作区域的高度
                                    int borHeight = height;

                                    WindowsFormsHost host            = this.conversationHost.winHost;
                                    System.Windows.Forms.Panel panel = this.conversationHost.panel;
                                    host.Width  = panel.Width = borWidth - 110;
                                    host.Height = panel.Height = borHeight - 30;

                                    //panel.MinimumSize = new System.Drawing.Size() { Height = 696 };

                                    //if(borHeight<715)
                                    //{
                                    //    host.Height = panel.Height = borHeight - 20;
                                    //}
                                    //else
                                    //{
                                    //    host.Height = panel.Height = borHeight - 30;
                                    //}

                                    LyncHelper.DockToNewParentWindow(panel.Handle, this.DockInit);
                                }));
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManage.WriteLog(this.GetType(), ex);
                    };
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
        }
コード例 #12
0
 /// <summary>
 /// 桌面共享
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnDeskShare_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         //桌面共享
         LyncHelper.ShareDesk();
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #13
0
 /// <summary>
 /// 填充数据
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="dataGrid">视图控件</param>
 private void FillDataGridCallBack(DataGrid dataGrid)
 {
     try
     {
         //填充参会人列表
         LyncHelper.FillLyncOnlineInfo(dataGrid);
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #14
0
        public ConversationM()
        {
            try
            {
                //UI加载
                InitializeComponent();

                //绑定当前上下文
                this.DataContext = this;

                //本地资源共享
                this.btnLocalResource.Click += btnLocalResource_Click;
                ////退出全屏
                //this.btnExitFullScreen.Click += btnExitFullScreen_Click;
                ////开启全屏
                //this.btnFullScreen.Click += btnFullScreen_Click;
                //电子白板
                this.btnWhiteboard.Click += btnWhiteboard_Click;

                this.btnPostil.Click += btnPostil_Click;
                //桌面共享
                this.btnDeskShare.Click += btnDeskShare_Click;
                //接任演示
                this.btnDemonstration.Click += btnDemonstration_Click;
                //手机投影
                this.btnprojection.Click += btnprojection_Click;
                //选项卡更改事件(演示,推送)
                this.tabControl.SelectionChanged += tabControl_SelectionChanged;

                //this.btnNext2.Click += btnNext_Click;

                //初始化加载
                //this.ParameterInit();

                //检测automation是否弹出的情况
                LyncHelper.CheckAutomationIsOpenAndActive(this.conversationHost.panel.Handle);

                //默认显示
                this.SetConversationAreaShow(ShowType.HidenView, false);
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #15
0
        /// <summary>
        /// 会话视图显示
        /// </summary>
        public bool SetConversationArea_Conversation()
        {
            bool isChanged = false;

            try
            {
                if (this.IsCanNavicateConversationView)
                {
                    if (LyncHelper.MainConversation != null && LyncHelper.MainConversation.State == ConversationWindowState.Initialized && LyncHelper.MainConversation.IsDocked)
                    {
                        //double width = this.conversationHost.ActualWidth;
                        //double height = this.conversationHost.ActualHeight;

                        //this.conversationHost.Width = 1;
                        //this.conversationHost.Height = 1;

                        LyncHelper.ShowWindowContent();
                        LyncHelper.FullScreen();

                        this.borConversation.Child = null;
                        this.borConversation.Child = this.conversationHost;



                        //this.conversationHost.Width = width;
                        //this.conversationHost.Height = height;

                        //封装的会话窗体内部实例
                        //uc.ConversationWindowClass conversationWindowClass = LyncHelper.MainConversation.InnerObject as uc.ConversationWindowClass;
                        //if (conversationWindowClass != null)
                        //{
                        //    conversationWindowClass.SetPreferredAnnotationTool(uc.AnnotationTool.ucAnnotationToolDrawArrowLine, 0x000000FF);
                        //}

                        isChanged = true;
                    }
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
            return(isChanged);
        }
コード例 #16
0
        /// <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
            {
            }
        }
コード例 #17
0
ファイル: App.xaml.cs プロジェクト: fkdl/conference-1
        /// <summary>
        /// 当前应用程序关闭时,注销该用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Current_Exit(object sender, ExitEventArgs e)
        {
            try
            {
                if (this.loginWindow != null)
                {
                    this.loginWindow.Close();
                }
                //设置DNS
                NetWorkAdapter.SetNetworkAdapter(Constant.RouteIp);
                //退出lync辅助
                LyncHelper.LyncSignOut(new Action(() =>
                {
                    if (LyncHelper.MainConversation != null)
                    {
                        ModelManage.ConferenceLyncConversation.RemoveConversation(Constant.ConferenceName, new Action <bool>((successed) =>
                        {
                        }));
                        //设置DNS
                        //NetWorkAdapter.EnableDHCP2();

                        //Conference.View.Tree.ConferenceTreeView.TittleEditControlTimer.Stop();
                        //Conference.View.IMM.ConferenceAudio_View.TittleEditControlTimer.Stop();

                        //LyncClient.GetAutomation().EndMeetNow(null);
                        LyncHelper.MainConversation.Close();
                    }
                }));
                //系统关闭辅助
                Current_Exit_Help();
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(App), ex);
            }
            finally
            {
                //关闭指定后台进程
                ProcessManage.KillProcess("Lync");
                //lync临时显示
                WindowHide.SetTrayIconAllDsiplay("Lync");
                //消除死亡托盘图标
                SysTray.Refresh();
            }
        }
コード例 #18
0
 void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         LyncHelper.CancelLyncSigned(new Action(() =>
         {
             //隐藏登陆提示
             this.IsLogining = System.Windows.Visibility.Hidden;
             //取消登陆
             this.Visibility = System.Windows.Visibility.Hidden;
         }));
         Application.Current.Shutdown(0);
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
 }
コード例 #19
0
        public void State1CallBackCompleate()
        {
            try
            {
                //是否进行过登陆验证
                if (this.IsLoginVerify)
                {
                    //(登陆窗体、登陆提示、开始菜单隐藏)
                    //登陆窗体隐藏
                    this.Visibility = System.Windows.Visibility.Hidden;
                    //登陆提示隐藏
                    this.IsLogining = System.Windows.Visibility.Hidden;

                    //设置当前用户名
                    LyncHelper.SetCurrentUser();

                    #region 进入主界面

                    ThreadPool.QueueUserWorkItem((o) =>
                    {
                        //创建客户端对象模型实例(并通过验证)
                        Constant.clientContextManage.CreateClient(Constant.SpaceWebSiteUri, Constant.LoginUserName, Constant.WebLoginPassword, Constant.UserDoaminPart1Name);

                        //设置DNS
                        //NetWorkAdapter.EnableDHCP2();
                    });

                    //创建主界面
                    MainWindow mainWindow = new MainWindow();

                    //显示主界面
                    mainWindow.Show();

                    #endregion
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #20
0
 /// <summary>
 /// 离开会议
 /// </summary>
 /// <param name="args"></param>
 private static void Lync_Leave(C_BaseData args)
 {
     try
     {
         //lync联系人异常实体
         lync_webData.LeaveConversationEntity leaveConversationEntity = args.LyncConversationFlg.LeaveConversationEntity;
         //退出会议的参会人
         string contactUri = leaveConversationEntity.ContactUri;
         //异常参会人
         LyncHelper.RemovePartical(contactUri);
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(typeof(MainPageBase), ex);
     }
     finally
     {
     }
 }
コード例 #21
0
        /// <summary>
        /// 获取会议地址上传到服务器(解除锁定)
        /// </summary>
        /// <param name="successed">是否上传成功</param>
        public void UPloadMeetAddressAndCancelLock(bool successed)
        {
            try
            {
                //只有会话初始化完毕才有的结果
                DispatcherTimer lynTimer = null;
                TimerJob.StartRun(new Action(() =>
                {
                    string address = LyncHelper.GetConversation_Address();
                    if (!string.IsNullOrEmpty(address))
                    {
                        lynTimer.Stop();
                        //开启会话
                        ModelManage.ConferenceLyncConversation.FillConversation(Constant.ConferenceName, address, new Action <bool>((issuccessed) =>
                        {
                            if (successed)
                            {
                                //允许其他成员进行会议查询并进行初始化
                                ModelManage.ConferenceLyncConversation.AllowConversationInit(Constant.ConferenceName, new Action <bool>((flg) =>
                                {
                                }));
                            }
                        }));

                        //释放dns(改为自由获取),主窗体状态还原(非置顶)
                        TimerJob.StartRun(new Action(() =>
                        {
                            //设置DNS
                            NetWorkAdapter.SetNetworkAdapter(Constant.RouteIp);
                            //取消置顶
                            MainWindow.mainWindow.Topmost = false;
                        }));
                    }
                }), 500, out lynTimer);
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #22
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
     {
     }
 }
コード例 #23
0
        /// <summary>
        /// 会话视图显示
        /// </summary>
        public bool SetConversationArea_HidenView()
        {
            bool isChanged = false;

            try
            {
                this.borConversation.Child = null;
                LyncHelper.HidenWindowContent();
                this.borConversation.Child = this.conversationHidenView;

                isChanged = true;
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
            return(isChanged);
        }
コード例 #24
0
 /// <summary>
 /// 加载卡片
 /// </summary>
 private void AddCardEventCallBack()
 {
     try
     {
         //关闭所有会话
         LyncHelper.CloseAllConversation(new Action(() =>
         {
             //离开会话
             ModelManage.ConferenceLyncConversation.LeaveConversation(MyConferenceCodeEnterEntity.ConferenceName, MyConferenceCodeEnterEntity.SelfUri, new Action <bool>((isSuccessed) =>
             {
             }));
         }));
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #25
0
        /// <summary>
        /// 创建或进入会话
        /// </summary>
        /// <param name="successed">执行是否包含会话是否成功</param>
        /// <param name="meetAddress">会议地址</param>
        private void MeetSetupOrEnter(bool successed, string meet_Address)
        {
            try
            {
                if (successed && string.IsNullOrEmpty(meet_Address))
                {
                    //禁止其他人进行查询完之后直接进行会话初始化(有可能在其中过程当中,第一个开启会话的人还没有准备完毕,所以记进行一次通知)
                    ModelManage.ConferenceLyncConversation.ForbiddenConversationInit(Constant.ConferenceName, new Action <bool>((flg) =>
                    {
                    }));

                    //判断主会话是否存在
                    if (LyncHelper.MainConversation == null)
                    {
                        //参会人列表
                        List <string> list = Constant.ParticipantList.Where(Item => Item.Equals(Constant.SelfUri)).ToList <string>();
                        //添加对应大屏
                        list.Add(Constant.BigScreenName);
                        //开启会话
                        LyncHelper.StartConference(Constant.lyncClient, Constant.ConferenceName, Constant.SelfName, list, LyncHelper.MainConversation);
                        //获取会议地址上传到服务器
                        this.UPloadMeetAddressAndCancelLock(successed);
                        this.meetAddress = meet_Address;
                    }
                }
                else
                {
                    this.meetAddress = meet_Address;
                    //使用浏览器的方式参会
                    LyncHelper.JoinConversationByWebBrowser(meet_Address);
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #26
0
 /// <summary>
 /// 共享协作回调中心
 /// </summary>
 public void CallBackEvent_Conversation()
 {
     try
     {
         //加载会话回调
         this.ConversationM.DockConversationWindowCallBack = DockConversationWindowCallBack;
         //共享页面同步回调
         this.ConversationM.ShareAndSyncCallBack = ShareAndSyncCallBack;
         //修复会话回调
         this.ConversationM.RepairConversationCallBack = RepairConversationCallBack;
         //lync会话事件注册
         LyncHelper.LyncConversationEventRegedit();
         //查看是否包含会议
         LyncHelper.HasConferenceCallBack = hasConferenceCallBack;
         //输出atuomation
         LyncHelper.MainConversationOutCallBack = mainConversationOutCallBack;
         //会话窗体加载内容完成事件
         LyncHelper.ConversationAddCompleateCallBack = conversationAddCompleateCallBack;
         //输入automation
         LyncHelper.MainConversationInCallBack = mainConversationInCallBack;
         //会话加载完成事件
         LyncHelper.ContentAddCompleateCallBack = contentAddCompleateCallBack;
         //会话移除事件
         LyncHelper.Content_DeskRemoveCompleateCallBack = Content_DeskRemoveCompleateCallBack;
         //返回演示人
         LyncHelper.PresentCallBack = presentCallBack;
         //共享窗体回调事件
         LyncHelper.ShareDeskCallBack = ShareDeskCallBack;
         //附加到新窗体回调
         LyncHelper.DockNewWindowCallBack = DockNewWindowCallBack;
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #27
0
 /// <summary>
 /// 关闭音视频
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnAVClose_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (LyncHelper.MainConversation != null)
         {
             //启动音频
             LyncHelper.Close_AV(LyncHelper.MainConversation);
         }
         else
         {
             MessageBox.Show("没有可操作的对象", "操作提示", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #28
0
        /// <summary>
        /// 开始连接()
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //判断共享协作页面是否加载
                if (ConversationM.conversationM != null)
                {
                    //是否进入大屏投影
                    switch (this.bigEnterScreen)
                    {
                    case BigEnterScreen.Enter:
                        //断开连接
                        bool canDisConnect = LyncHelper.DisConnectDeskShare();
                        if (!canDisConnect)
                        {
                            //如断开连接失败则及时更新状态
                            this.UpdateState(null);
                        }

                        break;

                    case BigEnterScreen.NoEnter:
                        //开始桌面共享
                        bool canConnect = LyncHelper.ShareDesk();
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (System.Exception ex)
            {
                LogManage.WriteLog(base.GetType(), ex);
            }
            finally
            {
            }
        }
コード例 #29
0
 /// <summary>
 /// 启动音频
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void btnAudio_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (LyncHelper.MainConversation != null)
         {
             //启动音频
             LyncHelper.StartAudio(LyncHelper.MainConversation);
         }
         else
         {
             MessageBox.Show("开启视频之前先选择一个会话", "操作提示", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
コード例 #30
0
 void btnPostil_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.CurrentShowType == ShowType.ConversationView)
         {
             this.SetConversationAreaShow(ShowType.HidenView, false);
             LyncHelper.HidenWindowContent();
             bool result = this.SetConversationArea_Conversation2();
             if (result)
             {
                 this.CurrentShowType = ShowType.ConversationView;
             }
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }