Ejemplo n.º 1
0
        private void NetworkDefinitionView_MouseUp(object sender,MouseEventArgs e)
        {
            CanTreeTag canTreeTag = (CanTreeTag)NetworkDefinitionView.SelectedNode.Tag;

            if (e.Button == MouseButtons.Left)
            {
                switch (canTreeTag.NodeType)
                {
                case CanTreeTag.BUS:
                case CanTreeTag.NODE: MainTabControl.SelectTab(1); break;

                case CanTreeTag.MESSAGE: MainTabControl.SelectTab(0); break;

                case CanTreeTag.SIGNAL: MainTabControl.SelectTab(0); break;

                default: break;
                }
            }

            if (e.Button == MouseButtons.Right)
            {
                switch (canTreeTag.NodeType)
                {
                case CanTreeTag.BUS: BusMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.NODE: NodeMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.MESSAGE: MessageMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                case CanTreeTag.SIGNAL: SignalMenuStrip.Show(NetworkDefinitionView,e.Location); break;

                default: break;
                }
            }
        }
Ejemplo n.º 2
0
 public NetworkDefinitionForm()
 {
     InitializeComponent();
     NetworkDefinitionView.NodeMouseClick += (sender, args) => NetworkDefinitionView.SelectedNode = args.Node;
     NodeMenuStrip.Hide();
     MessageMenuStrip.Hide();
     SignalMenuStrip.Hide();
 }