Beispiel #1
0
        public BoxSelector(MouseOperator mouseOperator)
        {
            _mouseOperator = mouseOperator;

            mouseOperator.PreMouseLeftButtonUp += MouseOperatorOnMouseLeftButtonUp;
            mouseOperator.PreMouseMove         += MouseOperatorOnMouseMove;

            Children.Add(_left   = new BoxSelectorBorder(false));
            Children.Add(_top    = new BoxSelectorBorder(true));
            Children.Add(_right  = new BoxSelectorBorder(false));
            Children.Add(_bottom = new BoxSelectorBorder(true));
        }
Beispiel #2
0
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        internal NodeSlotConnector(BiaNodeEditor parent, MouseOperator mouseOperator)
        {
            _parent = parent;

            for (var i = 0; i != RowCount * ColumnCount; ++i)
            {
                Children.Add(new LinkConnectorCell(this));
            }

            mouseOperator.LinkMoving += OnLinkMoving;
            SizeChanged += (_, e) => UpdateChildren(e.NewSize.Width, e.NewSize.Height);

            _parent.PreviewMouseUp += (_, __) => _mousePos = new ImmutableVec2_double(double.NaN, double.NaN);

            _sourceNotifier = new PropertyChangeNotifier(_parent, BiaNodeEditor.SourceNodeSlotConnectingProperty);
            _targetNotifier = new PropertyChangeNotifier(_parent, BiaNodeEditor.TargetNodeSlotConnectingProperty);

            _sourceNotifier.ValueChanged += ConnectionChangedHandler;
            _targetNotifier.ValueChanged += ConnectionChangedHandler;
        }