private void NewSignalMenuItem_Click(object sender,EventArgs e) { using NetworkSignalForm networkSignalForm = new NetworkSignalForm(); networkSignalForm.ShowDialog(); if (networkSignalForm.IsOk) { CanTreeTag canTreeTag = (CanTreeTag)NetworkDefinitionView.SelectedNode.Tag; ConfigService.AddSignal(networkSignalForm.Signal,canTreeTag.Message); TreeNode nodeTreeNode = AddNode(NetworkDefinitionView.SelectedNode.Nodes,networkSignalForm.Signal.name,CanTreeTag.SIGNAL,canTreeTag.Node,canTreeTag.Bus,canTreeTag.Message,networkSignalForm.Signal); NetworkDefinitionView.SelectedNode = nodeTreeNode; } }
private void EditSignalMenuItem_Click(object sender,EventArgs e) { CanTreeTag canTreeTag = (CanTreeTag)NetworkDefinitionView.SelectedNode.Tag; using NetworkSignalForm networkSignalForm = new NetworkSignalForm(canTreeTag.Signal); networkSignalForm.ShowDialog(); if (networkSignalForm.IsOk) { canTreeTag.Node.name = networkSignalForm.Signal.name; NetworkDefinitionView.SelectedNode.Text = networkSignalForm.Signal.name; NetworkDefinitionView.SelectedNode.ToolTipText = "(" + canTreeTag.Message.id + "): Offset:" + networkSignalForm.Signal.offset + " Length: " + networkSignalForm.Signal.length; } }