コード例 #1
0
 public ContextTree(RenderingEngine renderingEngine, ContextActionEventArgs args)
 {
     ContextActionEventArgs = args;
     IO = args.Selector;
     RenderingEngine = renderingEngine;
     InitializeComponent();
     treeView.AllowDrop = true;
 }
コード例 #2
0
        private void kryptonNavigator1_ContextAction(object sender, ContextActionEventArgs e)
        {
            // Because the 'new page' item does not have any text we need to manually set the
            // displayed text for 'new page' in the context menu strip, otherwise it will be blank
            KryptonContextMenuItems items = (KryptonContextMenuItems)e.KryptonContextMenu.Items[0];
            KryptonContextMenuItem  item  = (KryptonContextMenuItem)items.Items[items.Items.Count - 1];

            item.Text = "New Page";
        }
コード例 #3
0
 private void SelectionServiceOnContextAction(object sender, ContextActionEventArgs e)
 {
     if (!Renderer.RenderingEngine.SelectionService.ActionActive)
     {
         ContextTree contextTree = new ContextTree(Renderer.RenderingEngine, e)
         {
             StartPosition = FormStartPosition.Manual,
             Location      = Cursor.Position
         };
         contextTree.Finished -= ContextTreeOnFinished;
         contextTree.Finished += ContextTreeOnFinished;
         contextTree.Show();
     }
 }
コード例 #4
0
 private void kryptonNavigator1_ContextAction(object sender, ContextActionEventArgs e)
 {
     AddOutput("ContextAction");
 }
コード例 #5
0
 protected virtual void OnContextAction(ContextActionEventArgs e)
 {
     ContextAction?.Invoke(this, e);
 }
コード例 #6
0
        private void MouseServiceOnMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (!StartSelectionRectangle)
                {
                    var mouseOverItems           = RenderingEngine.CurrentProject.Items.Where(x => x.IsMouseOver);
                    InputOutputSelector selector = null;
                    foreach (var selectedItem in mouseOverItems)
                    {
                        selectedItem.IsSelected = true;

                        List <InputOutputBase> inputOutputs = new List <InputOutputBase>();

                        inputOutputs.AddRange(selectedItem.Inputs);
                        inputOutputs.AddRange(selectedItem.Outputs);

                        var mouseOverInputOutput = inputOutputs.FirstOrDefault(x => x.IsMouseOver);

                        if (mouseOverInputOutput != null)
                        {
                            selector = SetSelector(selectedItem, mouseOverInputOutput);
                            break;
                        }
                    }

                    if (NotComplete || !SignatureMatching)
                    {
                        if (InputOutputAvailable && !SelectorEquals(SelectedInputOutput, selector))
                        {
                            _lastDestinationPoint = RenderingEngine.TranslatedMousePosition;
                            _currentActionArgs    = new ContextActionEventArgs {
                                Selector = SelectedInputOutput, Location = e.Location
                            };
                            OnContextAction(_currentActionArgs);
                            _actionActive = true;
                        }
                        else
                        {
                            OnInComplete();
                            FinishContextActionIntern();
                        }
                    }
                    else
                    {
                        OnCompleted();
                        FinishContextActionIntern();
                    }
                }
                else
                {
                    var selectedItems = RenderingEngine.CurrentProject.Items.Where(x => RectangleF.Intersect(x.Rectangle, SelectionRectangleTranslated) != RectangleF.Empty);

                    foreach (var selectedItem in selectedItems)
                    {
                        selectedItem.IsSelected = true;
                        CurrentSelection.Add(selectedItem);
                    }
                }

                StartDrag = false;
            }
        }