コード例 #1
0
 private void ResetSelections()
 {
     // Clear selections.
     _selectionManager.Clear();
     _currentState = new IdleState(_selectionManager, new Point(0, 0));
     RaiseStateChange();
 }
コード例 #2
0
 private void HandleMouseEvent(Point location, MouseButtons mouseButtons, StateChangingTrigger mouseTrigger)
 {
     if (IsStateChanging(location, mouseTrigger, out MainFormState state))
     {
         _currentState = state;
         RaiseStateChange();
     }
 }
コード例 #3
0
        private bool IsStateChanging(Point location, StateChangingTrigger trigger, out MainFormState state)
        {
            var newState        = _currentState.UpdateState(location, trigger);
            var isStateChanging = _currentState != newState;

            if (isStateChanging)
            {
                _currentState = newState;
            }

            state = _currentState;
            return(isStateChanging);
        }
コード例 #4
0
 public MainFormViewModel(SelectionManager selectionManager)
 {
     _selectionManager = selectionManager;
     _currentState     = new IdleState(selectionManager, new Point());
     _exportLocation   = ConfigurationManager.AppSettings[Constants.ExportLocationAppSetting];
 }
コード例 #5
0
 internal void DeleteActiveSelection()
 {
     _selectionManager.RemoveSelection(_currentState.ActiveSelection);
     _currentState = new IdleState(_selectionManager, new Point());
 }