void AddFunctionCodeToolStripMenuItemClick(object sender, EventArgs e) { if (treeView1.SelectedNode != null) { AddFunctionCodeForm addFunctionCodeForm = new AddFunctionCodeForm(easyModbusManager, treeView1.SelectedNode.Index); addFunctionCodeForm.Show(); } }
void EditFunctionCodeToolStripMenuItemClick(object sender, EventArgs e) { if (treeView1.SelectedNode == null) { return; } int indexFunction = treeView1.SelectedNode.Index; int indexConnection = treeView1.SelectedNode.Parent.Index; if (treeView1.SelectedNode.Level == 2) { AddFunctionCodeForm addFunctionCodeForm = new AddFunctionCodeForm(easyModbusManager, indexConnection, indexFunction); addFunctionCodeForm.ShowDialog(); } }