Ejemplo n.º 1
0
        void TypePanelMouseClick(object sender, MouseEventArgs e)
        {
            if (Controller.Enabled)
            {
                NodePanel nodePanel = _layout.LocatePanel(e.Location);

                if (nodePanel != null)
                {
                    Controller.SelectNode(nodePanel.TreeNode);

                    if (e.Button == MouseButtons.Right)
                    {
                        if (Controller.ContextMenuIsVisible)
                        {
                            Controller.HideContextMenu();
                            Invalidate();
                        }
                        else
                        {
                            Controller.ShowContextMenu(PointToScreen(e.Location));
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void MatrixPanelMouseClick(object sender, MouseEventArgs e)
        {
            if (Controller.Enabled)
            {
                NodePanel providerNodePanel = _hLayout.LocatePanel(e.Location);
                NodePanel consumerNodePanel = _vLayout.LocatePanel(e.Location);

                if (providerNodePanel != null && consumerNodePanel != null)
                {
                    Controller.SelectProviderNode(providerNodePanel.TreeNode);
                    Controller.SelectConsumerNode(consumerNodePanel.TreeNode);

                    if (e.Button == MouseButtons.Right)
                    {
                        if (Controller.ContextMenuIsVisible)
                        {
                            Controller.HideContextMenu();
                            Invalidate();
                        }
                        else
                        {
                            Controller.ShowContextMenu(PointToScreen(e.Location));
                        }
                    }
                }
            }
        }