internal void EnableAction(DotNetPropertyGridAction action, bool enabled = true) { if (actionButtons.ContainsKey(action)) { actionButtons[action].Enabled = enabled; } }
private void HandleDotNetPropertyGridAction(DotNetPropertyGridAction action) { switch (action) { case DotNetPropertyGridAction.Previous: if (history.HasPrevious) { history.MoveToPrevious(); } OnCurrentInfoChanged(); break; case DotNetPropertyGridAction.Next: if (history.HasNext) { history.MoveToNext(); } OnCurrentInfoChanged(); break; case DotNetPropertyGridAction.Parent: if (CanExecuteAction(DotNetPropertyGridAction.Parent)) { Target = CurrentInfo.ControlInfo.Control.Parent.Handle; } break; case DotNetPropertyGridAction.Highlight: if (CanExecuteAction(DotNetPropertyGridAction.Highlight)) { WindowHelper.DrawAdorner(Target); } break; } }
private void RaiseActionClicked(DotNetPropertyGridAction action) { if (ActionClicked != null) { ActionClicked(this, new DotNetPropertyGridActionEventArgs(action)); } }
private bool CanExecuteAction(DotNetPropertyGridAction action) { switch (action) { case DotNetPropertyGridAction.Previous: return history.HasPrevious; case DotNetPropertyGridAction.Next: return history.HasNext; case DotNetPropertyGridAction.Parent: return CurrentInfo != null && CurrentInfo.ControlInfo != null && CurrentInfo.ControlInfo.Control != null && CurrentInfo.ControlInfo.Control.Parent != null; case DotNetPropertyGridAction.Highlight: return Target != IntPtr.Zero; } return false; }
/// <summary> /// Initializes a new instance of the <see cref="DotNetPropertyGridActionEventArgs"/> class. /// </summary> /// <param name="action">The action.</param> public DotNetPropertyGridActionEventArgs(DotNetPropertyGridAction action) { Action = action; }
/// <summary> /// Initializes a new instance of the <see cref="DotNetPropertyGridActionEventArgs"/> class. /// </summary> /// <param name="action">The action.</param> public DotNetPropertyGridActionEventArgs(DotNetPropertyGridAction action) { Action = action; }
internal void EnableAction(DotNetPropertyGridAction action, bool enabled = true) { if (actionButtons.ContainsKey(action)) actionButtons[action].Enabled = enabled; }
private void RaiseActionClicked(DotNetPropertyGridAction action) { if (ActionClicked != null) ActionClicked(this, new DotNetPropertyGridActionEventArgs(action)); }
private void HandleDotNetPropertyGridAction(DotNetPropertyGridAction action) { switch (action) { case DotNetPropertyGridAction.Previous: if (history.HasPrevious) history.MoveToPrevious(); OnCurrentInfoChanged(); break; case DotNetPropertyGridAction.Next: if (history.HasNext) history.MoveToNext(); OnCurrentInfoChanged(); break; case DotNetPropertyGridAction.Parent: if (CanExecuteAction(DotNetPropertyGridAction.Parent)) Target = CurrentInfo.ControlInfo.Control.Parent.Handle; break; case DotNetPropertyGridAction.Highlight: if (CanExecuteAction(DotNetPropertyGridAction.Highlight)) WindowHelper.DrawAdorner(Target); break; } }
private bool CanExecuteAction(DotNetPropertyGridAction action) { switch (action) { case DotNetPropertyGridAction.Previous: return history.HasPrevious; case DotNetPropertyGridAction.Next: return history.HasNext; case DotNetPropertyGridAction.Parent: return CurrentInfo != null && CurrentInfo.ControlInfo != null && CurrentInfo.ControlInfo.Control != null && CurrentInfo.ControlInfo.Control.Parent != null; case DotNetPropertyGridAction.Highlight: return Target != IntPtr.Zero; } return false; }