System\Windows\Forms\ToolTip\KeyboardToolTipStateMachine.cs (33)
44private SmState _currentState = SmState.Hidden;
55private SmState Transition(IKeyboardToolTip tool, ToolTip tooltip, SmEvent @event)
58(SmState.Hidden, SmEvent.FocusedTool) => SetupInitShowTimer(tool, tooltip),
59(SmState.Hidden, SmEvent.LeftTool) => _currentState, // OK
60(SmState.ReadyForInitShow, SmEvent.FocusedTool) => _currentState, // unlikely: focus without leave
61(SmState.ReadyForInitShow, SmEvent.LeftTool) => FullFsmReset(),
62(SmState.ReadyForInitShow, SmEvent.InitialDelayTimerExpired) => ShowToolTip(tool, tooltip),
64(SmState.Shown, SmEvent.FocusedTool) => _currentState, // unlikely: focus without leave
65(SmState.Shown, SmEvent.LeftTool) => HideAndStartWaitingForRefocus(tool, tooltip),
66(SmState.Shown, SmEvent.DismissTooltips) => FullFsmReset(),
68(SmState.WaitForRefocus, SmEvent.FocusedTool) => SetupReshowTimer(tool, tooltip),
69(SmState.WaitForRefocus, SmEvent.LeftTool) => _currentState, // OK
70(SmState.WaitForRefocus, SmEvent.RefocusWaitDelayExpired) => FullFsmReset(),
72(SmState.ReadyForReshow, SmEvent.FocusedTool) => _currentState, // unlikely: focus without leave
73(SmState.ReadyForReshow, SmEvent.LeftTool) => StartWaitingForRefocus(tool),
74(SmState.ReadyForReshow, SmEvent.ReshowDelayTimerExpired) => ShowToolTip(tool, tooltip),
158private SmState HideAndStartWaitingForRefocus(IKeyboardToolTip tool, ToolTip toolTip)
168private SmState StartWaitingForRefocus(IKeyboardToolTip tool)
175if (toolObject is not null && _currentState == SmState.WaitForRefocus && _refocusDelayExpirationCallback == expirationCallback)
181return SmState.WaitForRefocus;
184private SmState SetupReshowTimer(IKeyboardToolTip tool, ToolTip toolTip)
190return SmState.ReadyForReshow;
193private SmState ShowToolTip(IKeyboardToolTip tool, ToolTip toolTip)
203return SmState.Shown;
218return SmState.Shown;
221private SmState SetupInitShowTimer(IKeyboardToolTip tool, ToolTip toolTip)
228return SmState.ReadyForInitShow;
283if (_currentState != SmState.Shown || _currentTool is null)
295_currentState = SmState.Hidden;
299private SmState FullFsmReset()
301if (_currentState == SmState.Shown && _currentTool is not null)
309return _currentState = SmState.Hidden;