예제 #1
0
        private void OnGlobalMouseRightButtonUp(object sender, MouseButtonEventArgsInt e)
        {
            if (_rightButtonDownInfo.IsEmpty == false)
            {
                QueryCloseOnUp(_rightButtonDownInfo, GetMouseDownInfo(e), e);
            }

            _rightButtonDownInfo = MouseButtonEventInfo.Empty;
        }
예제 #2
0
        private void OnLocalMouseRightUp(object sender, MouseButtonEventArgs e)
        {
            if (_rightButtonDownInfo.IsEmpty == false)
            {
                var mouseButtonEventArgsInt = e.ToMouseButtonEventArgsInt(MouseButton.Right, MouseButtonState.Released);

                QueryCloseOnUp(_rightButtonDownInfo, GetMouseDownInfo(mouseButtonEventArgsInt), mouseButtonEventArgsInt);
            }

            _rightButtonDownInfo = MouseButtonEventInfo.Empty;
        }
예제 #3
0
        private void QueryCloseOnUp(MouseButtonEventInfo downButtonEventInfo, MouseButtonEventInfo upEventInfo, MouseButtonEventArgsInt e)
        {
            var inside = upEventInfo.IsInside;

            if (inside == false)
            {
                if (downButtonEventInfo.IsInside == false)
                {
                    QueryCloseCore(new MouseButtonEventPopupCloseReason(e.OriginalArgs));
                }
            }
        }
예제 #4
0
        private void ExitOpenState()
        {
            FocusObserver.KeyboardFocusedElementChanged -= OnKeyboardFocusedElementChanged;
            DetachGlobalMouseEvents();

#if !SILVERLIGHT
            _foregroundSession = _foregroundSession.DisposeExchange();
            HwndMouseObserver.RemoveListener(this);
#endif

            _leftButtonDownInfo  = MouseButtonEventInfo.Empty;
            _rightButtonDownInfo = MouseButtonEventInfo.Empty;

            _state = State.Closed;
        }
예제 #5
0
 private void OnLocalMouseRightDown(object sender, MouseButtonEventArgs e)
 {
     _rightButtonDownInfo = GetMouseDownInfo(e.ToMouseButtonEventArgsInt(MouseButton.Right, MouseButtonState.Pressed));
 }
예제 #6
0
        private void OnGlobalPreviewMouseRightButtonDown(object sender, MouseButtonEventArgsInt e)
        {
            _rightButtonDownInfo = GetMouseDownInfo(e);

            QueryCloseOnDown(e);
        }
예제 #7
0
        private void OnGlobalMouseLeftButtonDown(object sender, MouseButtonEventArgsInt e)
        {
            _leftButtonDownInfo = GetMouseDownInfo(e);

            QueryCloseOnDown(e);
        }