Detect() public static method

public static Detect ( ) : TaskbarLocation
return TaskbarLocation
コード例 #1
0
ファイル: PopupForm.cs プロジェクト: yzwbrian/SystemEx
        private void CalculatePopupRect()
        {
            var sPopupSize = _current.Size;
            var sOffset    = _current.BorderOffset;

            var rc = new Rectangle();

            var tl = TaskbarLocation.Detect();

            rc = GetTaskbarPopupLocation(tl, sPopupSize, sOffset);

            _current.Location = rc;

            _edge = tl.Edge;

            var pt = new Point(
                rc.Left + rc.Width / 2,
                rc.Top + rc.Height / 2
                );

            _popupScreen = Screen.FromPoint(pt);
        }
コード例 #2
0
ファイル: FlyoutForm.cs プロジェクト: yzwbrian/SystemEx
        private void UpdatePosition()
        {
            var location = TaskbarLocation.Detect();

            var bounds = location.WorkArea;

            bounds.Inflate(-10, -10);

            int top    = bounds.Top;
            int left   = bounds.Left;
            int right  = bounds.Right;
            int bottom = bounds.Bottom;

            switch (location.Edge)
            {
            case TaskbarLocationEdge.Top:
                bottom = top + Height;
                break;

            default:
                top = bottom - Height;
                break;
            }

            switch (location.Edge)
            {
            case TaskbarLocationEdge.Left:
                right = left + Width;
                break;

            default:
                left = right - Width;
                break;
            }

            SetBounds(left, top, right - left, bottom - top);
        }
コード例 #3
0
ファイル: FlyoutForm.cs プロジェクト: yzwbrian/SystemEx
        private bool ShouldShowPopup()
        {
            var popupScreen = Screen.FromPoint(TaskbarLocation.Detect().WorkArea.Location);

            return(PopupUtil.ShouldShowPopup(this, popupScreen));
        }