private void Transit(SmEvent @event, IKeyboardToolTip source) { bool fullFsmResetRequired = false; try { ToolTip toolTip = _toolToTip[source]; if ((_currentTool == null || _currentTool.CanShowToolTipsNow()) && toolTip != null) { _currentState = Transition(source, toolTip, @event); } else { fullFsmResetRequired = true; } } catch { fullFsmResetRequired = true; throw; } finally { if (fullFsmResetRequired) { FullFsmReset(); } } }
private void Transit(SmEvent @event, IKeyboardToolTip source) { Debug.Assert(transitions.ContainsKey(new SmTransition(this.currentState, @event)), "Unsupported KeyboardToolTipFsmTransition!"); bool fullFsmResetRequired = false; try { ToolTip toolTip = this.toolToTip[source]; if ((this.currentTool == null || this.currentTool.CanShowToolTipsNow()) && toolTip != null) { Func <IKeyboardToolTip, ToolTip, SmState> transitionFunction = transitions[new SmTransition(this.currentState, @event)]; this.currentState = transitionFunction(source, toolTip); } else { fullFsmResetRequired = true; } } catch { fullFsmResetRequired = true; throw; } finally { if (fullFsmResetRequired) { this.FullFsmReset(); } } }
private Type Transition(SmState state) { if (currentState == GoToState.Pulsed) { return(typeof(SmsGoTo)); } return(null); }
private Type DoneTransition(SmState state) { if (currentState != GoToState.Active) { return(typeof(SmsIdle)); } return(null); }
private SmState FullFsmReset() { if (_currentState == SmState.Shown && _currentTool != null) { ToolTip currentToolTip = _toolToTip[_currentTool]; if (currentToolTip != null) { currentToolTip.HideToolTip(_currentTool); } } ResetTimer(); _currentTool = null; return(_currentState = SmState.Hidden); }
private SmState FullFsmReset() { if (this.currentState == SmState.Shown && this.currentTool != null) { ToolTip currentToolTip = this.toolToTip[this.currentTool]; if (currentToolTip != null) { currentToolTip.HideToolTip(this.currentTool); } } this.ResetTimer(); this.currentTool = null; return(this.currentState = SmState.Hidden); }
public SmTransition(SmState currentState, SmEvent @event) { this.currentState = currentState; this.@event = @event; }