GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoContextMenu Class
Members Example
In This Topic
    GoContextMenu Class
    In This Topic
    GoContextMenu is just a ContextMenu that provides an easy way to get the GoView in which a context menu MenuItem.Click event handler was invoked.
    Syntax
    [ToolboxItem(false)]
    [DesignTimeVisible(false)]
    [DefaultEvent("Popup")]
    [ToolboxItemFilter("System.Windows.Forms")]
    [ListBindable(false)]
    [DesignerCategory("Component")]
    public class GoContextMenu : System.Windows.Forms.ContextMenu 
    Example
    Adding a context menu to a particular node class:
    public override GoContextMenu GetContextMenu(GoView view) {
      GoContextMenu cm = new GoContextMenu(view);
      cm.MenuItems.Add(new MenuItem("Copy", new EventHandler(this.Copy_Command)));
      return cm;
    }
    private void Copy_Command(Object sender, EventArgs e) {
      GoView v = GoContextMenu.FindView(sender as MenuItem);
      if (v != null)
        v.EditCopy();
    }
    See Also