/// <summary> /// Bring up a context menu when the user context clicks in the background. /// </summary> /// <param name="evt"></param> protected override void OnBackgroundContextClicked(GoInputEventArgs e) { base.OnBackgroundContextClicked(e); // set up the background context menu GoContextMenu cm = new GoContextMenu(this); if (CanInsertObjects()) cm.MenuItems.Add(new MenuItem("Paste", new EventHandler(this.Paste_Command))); if (cm.MenuItems.Count > 0) cm.MenuItems.Add(new MenuItem("-")); cm.MenuItems.Add(new MenuItem("Properties", new EventHandler(this.Properties_Command))); cm.Show(this, e.ViewPoint); }
protected override void OnBackgroundContextClicked(GoInputEventArgs evt) { base.OnBackgroundContextClicked(evt); GoContextMenu cm = new GoContextMenu(this); if (_buckets?.Any() ?? false) { foreach (var bucket in _buckets) { AddMenu(cm, _actions[bucket]); } } cm.Show(this, evt.ViewPoint); }
/// <summary> /// Bring up a context menu when the user context clicks in the background. /// </summary> /// <param name="evt"></param> protected override void OnBackgroundContextClicked(GoInputEventArgs evt) { base.OnBackgroundContextClicked(evt); // set up the background context menu GoContextMenu cm = new GoContextMenu(this); //if (CanInsertObjects()) // cm.Items.Add(new ToolStripMenuItem("Paste", null, new EventHandler(this.Paste_Command))); if (cm.Items.Count > 0) { cm.Items.Add(new ToolStripSeparator()); } cm.Items.Add(new ToolStripMenuItem("Properties", null, new EventHandler(this.Properties_Command))); cm.Show(this, evt.ViewPoint); }