예제 #1
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);
            }
        }
예제 #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)
                        {
                            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);
            }
        }
예제 #3
0
 public void DockInit(bool isSuccessed)
 {
     try
     {
         if (isSuccessed)
         {
             DispatcherTimer timer = null;
             TimerJob.StartRun(new Action(() =>
             {
                 LyncHelper.ShowWindowContent();
                 bool result = LyncHelper.FullScreen();
                 if (result)
                 {
                     if (LyncHelper.MainConversation.IsFullScreen)
                     {
                         timer.Stop();
                         this.IsCanNavicateConversationView = true;
                         this.SetConversationAreaShow(ShowType.ConversationView, false);
                     }
                 }
             }), 1000, out timer);
         }
         else
         {
             System.Windows.Forms.Panel panel = this.conversationHost.panel;
             LyncHelper.DockToNewParentWindow(panel.Handle, this.DockInit);
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }