Exemplo n.º 1
0
 public WndAssist(ChatDesk desk)
 {
     _handle                     = 0;
     _hasOwner                   = false;
     IsWakeUp                    = false;
     _closingHwndBag             = new ConcurrentBag <int>();
     _unDealMessageTipDialogClue = new List <WinApi.WindowClue>
     {
         new WinApi.WindowClue(WinApi.ClsNameEnum.StandardWindow, null, 1),
         new WinApi.WindowClue(WinApi.ClsNameEnum.StandardButton, "确定", -1)
     };
     _prePopTime       = DateTime.MinValue;
     _closeDialogCount = 0;
     _popTooMany       = false;
     _isTracking       = false;
     _isFirstTrack     = true;
     _ratio            = null;
     IsShowRightPanel  = true;
     _preMouseDownTime = DateTime.MinValue;
     InitializeComponent();
     if (!DesignerProperties.GetIsInDesignMode(this))
     {
         try
         {
             try
             {
                 string text = "微软雅黑";
                 if (IsFontFamilyExist(text))
                 {
                     base.FontFamily = new System.Windows.Media.FontFamily(text);
                 }
             }
             catch (Exception e)
             {
                 Log.Exception(e);
             }
             FontSize = (double)Params.Other.FontSize;
             Desk     = desk;
             this.xHideToAltTab();
             Left   = 0.0;
             Top    = 0.0;
             Width  = SystemParameters.VirtualScreenWidth;
             Height = SystemParameters.WorkArea.Height;
             InitDeskEvent();
             Closed += WndAssist_Closed;
             HiddenControls();
             InitControls();
             Loaded += WndAssist_Loaded;
         }
         catch (Exception e2)
         {
             Log.Exception(e2);
         }
     }
 }
Exemplo n.º 2
0
 private void Desk_EvMaximize(object sender, ChatDeskEventArgs e)
 {
     Desk.ShowNormal();
     DispatcherEx.xInvoke(() =>
     {
         XYRatio toLogicalRatio = ToLogicalRatio;
         double maxW            = SystemParameters.WorkArea.Width - (double)WaParams.GetRightPanelWidth(Desk.Seller) - (double)12f;
         int w       = (int)(maxW / toLogicalRatio.XRatio);
         double maxH = SystemParameters.WorkArea.Height - (double)WaParams.GetBottomPanelHeight(Desk.Seller) - (double)12f;
         int h       = (int)(maxH / toLogicalRatio.YRatio);
         Desk.SetRect(6, 6, w, h);
     });
     Track(false, false);
 }