Example #1
0
 internal void EnableAction(DotNetPropertyGridAction action, bool enabled = true)
 {
     if (actionButtons.ContainsKey(action))
     {
         actionButtons[action].Enabled = enabled;
     }
 }
Example #2
0
        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;
            }
        }
Example #3
0
 private void RaiseActionClicked(DotNetPropertyGridAction action)
 {
     if (ActionClicked != null)
     {
         ActionClicked(this, new DotNetPropertyGridActionEventArgs(action));
     }
 }
Example #4
0
        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;
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DotNetPropertyGridActionEventArgs"/> class.
 /// </summary>
 /// <param name="action">The action.</param>
 public DotNetPropertyGridActionEventArgs(DotNetPropertyGridAction action)
 {
     Action = action;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DotNetPropertyGridActionEventArgs"/> class.
 /// </summary>
 /// <param name="action">The action.</param>
 public DotNetPropertyGridActionEventArgs(DotNetPropertyGridAction action)
 {
     Action = action;
 }
Example #7
0
 internal void EnableAction(DotNetPropertyGridAction action, bool enabled = true)
 {
     if (actionButtons.ContainsKey(action))
         actionButtons[action].Enabled = enabled;
 }
Example #8
0
 private void RaiseActionClicked(DotNetPropertyGridAction action)
 {
     if (ActionClicked != null)
         ActionClicked(this, new DotNetPropertyGridActionEventArgs(action));
 }
Example #9
0
 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;
     }
 }
Example #10
0
        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;
        }