Esempio n. 1
0
        private bool MouseInToolBar(MouseButtonEventArgs e)
        {
            bool  flag          = false;
            Point visualTopLeft = VisualTree.GetVisualTopLeft(this.curwin, this.curwin);

            if ((MouseHelper.GetCursorPos().Y - visualTopLeft.Y) <= 70.0)
            {
                flag = true;
            }
            return(flag);
        }
Esempio n. 2
0
 private void Calculate(Window win)
 {
     if (this.captionInfo.IncludeElement != null)
     {
         this.captionInfo.IncludeRect = VisualTree.GetVisualRect(win, this.captionInfo.IncludeElement);
     }
     if (this.captionInfo.ExIncludesElement != null)
     {
         this.captionInfo.ExIncludesRect = new Rect[this.captionInfo.ExIncludesElement.Length];
         for (int i = 0; i < this.captionInfo.ExIncludesElement.Length; i++)
         {
             this.captionInfo.ExIncludesRect[i] = VisualTree.GetVisualRect(win, this.captionInfo.ExIncludesElement[i]);
         }
     }
 }
Esempio n. 3
0
        private bool WmNcHitTest(IntPtr lParam, ref IntPtr result)
        {
            int    num           = WinAPI.SignedLOWORD(lParam);
            int    num2          = WinAPI.SignedHIWORD(lParam);
            Point  visualTopLeft = VisualTree.GetVisualTopLeft(this.layoutRoot, this.curwin);
            double x             = visualTopLeft.X;
            double y             = visualTopLeft.Y;
            double num5          = x + this.layoutRoot.ActualWidth;
            double num6          = visualTopLeft.Y + this.layoutRoot.ActualHeight;
            double num7          = 4.0;
            bool   flag          = ((num - x) <= num7) && ((num - x) >= 0.0);
            bool   flag2         = ((num5 - num) <= num7) && ((num5 - num) >= 0.0);
            bool   flag3         = ((num2 - y) <= num7) && ((num2 - y) >= 0.0);
            bool   flag4         = ((num6 - num2) <= num7) && ((num6 - num2) >= 0.0);

            if ((flag || flag2) || (flag3 || flag4))
            {
                if (flag && flag3)
                {
                    result = (IntPtr)13L;
                }
                else if (flag && flag4)
                {
                    result = (IntPtr)0x10L;
                }
                else if (flag2 && flag3)
                {
                    result = (IntPtr)14L;
                }
                else if (flag2 && flag4)
                {
                    result = (IntPtr)0x11L;
                }
                else if (flag)
                {
                    result = (IntPtr)10L;
                }
                else if (flag2)
                {
                    result = (IntPtr)11L;
                }
                else if (flag3)
                {
                    result = (IntPtr)12L;
                }
                else if (flag4)
                {
                    result = (IntPtr)15L;
                }
                return(true);
            }
            bool flag5 = false;

            if (this.captionHelper.CanCaption)
            {
                flag5 = this.captionHelper.IsInCaption(this.curwin, this.curwin.PointFromScreen(new Point((double)num, (double)num2)));
            }
            else
            {
                flag5 = (((num > (x + 62.0)) && (num < (num5 - 70.0))) && (num2 > (y + 1.0))) && (num2 < (y + this.CaptionHeight));
            }
            if (flag5)
            {
                result = (IntPtr)2L;
                return(true);
            }
            return(false);
        }