/// <summary> /// Creates a new MDbgModeItem object. /// </summary> /// <param name="shortcut">A shortcut for the mode command.</param> /// <param name="description">A description of what this mode represents.</param> /// <param name="modeValueCallback">An event that is called whenever current value of the mode is queried.</param> /// <param name="modeChangedCallback">An event that is called whenever user changes mode with mode command.</param> public MDbgModeItem(string shortcut, string description, GetModeValueEvent modeValueCallback, ModeChangedEvent modeChangedCallback) { Debug.Assert(!string.IsNullOrEmpty(shortcut)); Debug.Assert(!string.IsNullOrEmpty(description)); Debug.Assert(modeChangedCallback != null); Debug.Assert(modeValueCallback != null); if (string.IsNullOrEmpty(shortcut) || string.IsNullOrEmpty(description) || modeChangedCallback == null || modeValueCallback == null) { throw new ArgumentException(); } m_shortcut = shortcut; m_description = description; m_getModeValue = modeValueCallback; m_onModeChanged = modeChangedCallback; }
protected virtual void OnModeChanged(RemoteServer server, ModeChangedEventArgs args) { ModeChangedEvent?.Invoke(server, args); }
/// <summary> /// Creates a new MDbgModeItem object. /// </summary> /// <param name="shortcut">A shortcut for the mode command.</param> /// <param name="description">A description of what this mode represents.</param> /// <param name="modeValueCallback">An event that is called whenever current value of the mode is queried.</param> /// <param name="modeChangedCallback">An event that is called whenever user changes mode with mode command.</param> public MDbgModeItem(string shortcut, string description, GetModeValueEvent modeValueCallback, ModeChangedEvent modeChangedCallback) { Debug.Assert(!string.IsNullOrEmpty(shortcut)); Debug.Assert(!string.IsNullOrEmpty(description)); Debug.Assert(modeChangedCallback != null); Debug.Assert(modeValueCallback != null); if (string.IsNullOrEmpty(shortcut) || string.IsNullOrEmpty(description) || modeChangedCallback == null || modeValueCallback == null) throw new ArgumentException(); m_shortcut = shortcut; m_description = description; m_getModeValue = modeValueCallback; m_onModeChanged = modeChangedCallback; }
protected virtual void OnModeChanged(char mode, string parameter, string setter, string target, ModeType type) { ModeChangedEvent.Raise(this, new ModeChangedEventArgs(mode, parameter, setter, target, type)); }