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); }
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); }
private bool ShouldShowPopup() { var popupScreen = Screen.FromPoint(TaskbarLocation.Detect().WorkArea.Location); return(PopupUtil.ShouldShowPopup(this, popupScreen)); }