public TreeViewNode_Selector(TreeView tv, Node_DataSelector impl) : base(tv, impl) { Impl = impl; ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("セレクタを追加(&A)", null, AddSelector, Keys.A & Keys.Control) ); ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("回帰曲線を追加(&A)", null, AddMagicFormula, Keys.B & Keys.Control) ); }
void AddSelector(object sender, EventArgs e) { ConfirmIfNotUpdated(); var selectorImpl = new Node_DataSelector( StaticFunctions.GetUniqueName(this.TreeView, "新規セレクタ"), Impl, true ); var selector = new TreeViewNode_Selector( this.TreeView, selectorImpl ); this.Nodes.Add(selector); this.Expand(); }