예제 #1
0
 public Connection(Connector source, Connector sink)
 {
     this.ID = Guid.NewGuid();
     this.Source = source;
     this.Sink = sink;
     base.Unloaded += new RoutedEventHandler(Connection_Unloaded);
 }
 public ConnectorAdorner(DesignerCanvas designer, Connector sourceConnector)
     : base(designer)
 {
     this.designerCanvas = designer;
     this.sourceConnector = sourceConnector;
     drawingPen = new Pen(Brushes.LightSlateGray, 1);
     drawingPen.LineJoin = PenLineJoin.Round;
     this.Cursor = Cursors.Cross;
 }
        void thumbDragThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.HitDesignerItem = null;
            this.HitConnector = null;
            this.pathGeometry = null;
            this.Cursor = Cursors.Cross;
            this.connection.StrokeDashArray = new DoubleCollection(new double[] { 1, 2 });

            if (sender == sourceDragThumb)
            {
                fixConnector = connection.Sink;
                dragConnector = connection.Source;
            }
            else if (sender == sinkDragThumb)
            {
                dragConnector = connection.Sink;
                fixConnector = connection.Source;
            }
        }