private void ResetSelections() { // Clear selections. _selectionManager.Clear(); _currentState = new IdleState(_selectionManager, new Point(0, 0)); RaiseStateChange(); }
private void HandleMouseEvent(Point location, MouseButtons mouseButtons, StateChangingTrigger mouseTrigger) { if (IsStateChanging(location, mouseTrigger, out MainFormState state)) { _currentState = state; RaiseStateChange(); } }
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); }
public MainFormViewModel(SelectionManager selectionManager) { _selectionManager = selectionManager; _currentState = new IdleState(selectionManager, new Point()); _exportLocation = ConfigurationManager.AppSettings[Constants.ExportLocationAppSetting]; }
internal void DeleteActiveSelection() { _selectionManager.RemoveSelection(_currentState.ActiveSelection); _currentState = new IdleState(_selectionManager, new Point()); }