public override void Draw(StreamGeometryContext context, Connection connection)
        {
            if (connection.SourceConnectionPoint == null || connection.TargetConnectionPoint == null)
            {
                context.BeginFigure(connection.StartPoint, true, false);
                context.LineTo(connection.EndPoint, true, true);
            }
            else if(connection.Source == connection.Target)
            {
                Point startPoint = connection.SourceEndPoint.EndPoint;
                Point midPoint = connection.SourceConnectionPoint.LineAwayFromThisTo(startPoint, 50);

                context.BeginFigure(startPoint, true, true);
                context.ArcTo(midPoint, new Size(50, 50), 180, false, SweepDirection.Clockwise, true, true);
                context.ArcTo(startPoint, new Size(50, 50), 180, false, SweepDirection.Clockwise, true, true);
            }
            else
            {
                Point startPoint = connection.SourceEndPoint.EndPoint;
                Point endPoint = connection.TargetEndPoint.EndPoint;

                context.BeginFigure(startPoint, true, false);
                context.LineTo(endPoint, true, true);
            }
        }
        public void Draw(StreamGeometryContext context, Connection connection)
        {
            Point startPoint = connection.SourceEndPoint.EndPoint;
            Point endPoint = connection.TargetEndPoint.EndPoint;

            context.BeginFigure(startPoint, true, false);
            context.LineTo(endPoint, true, true);
        }
        public ConnectionDragger(DiagramSurface surface, MainWindow window, Point startPoint, Connection originalConnection, bool isStartOfConnection)
            : base(surface, window, startPoint)
        {
            _OriginalConnection = originalConnection;
            _IsStartOfConnection = isStartOfConnection;
            _OriginalConnectionPoint = isStartOfConnection
                                       	? originalConnection.SourceConnectionPoint
                                       	: originalConnection.TargetConnectionPoint;
            _OriginalConnectionBrush = _OriginalConnection.Stroke;

            SetupMouse();
        }
示例#4
0
        public static void SetConnectionStartPointBinding(Connection connection, ConnectionPoint connPoint)
        {
            if (connPoint == null) throw new ArgumentNullException("connPoint");

            connection.SetBinding(StartPointProperty, new Binding { Source = connPoint, Path = new PropertyPath(ConnectionPoint.LocationProperty) });
            connection.SourceConnectionPoint = connPoint;
        }
示例#5
0
 public static void SetConnectionPointBinding(Connection connection, ConnectionPoint sourceConnPoint, ConnectionPoint targetConnPoint)
 {
     SetConnectionStartPointBinding(connection, sourceConnPoint);
     SetConnectionEndPointBinding(connection, targetConnPoint);
 }
示例#6
0
        public void SetVisibility(Connection connection, Visibility visibility)
        {
            visibleConnections.Remove(connection);

            if (visibility == Visibility.Visible)
                visibleConnections.Add(connection);
        }
示例#7
0
 public void RemoveConnection(Connection connection)
 {
     Schema.RemoveConnection(connection);
     connection.Visible = false;
 }
示例#8
0
 public void ConnectionSelected(Connection entity)
 {
     OnConnectionSelected.RaiseEvent(this, new SchemaEventArgs<Connection>(entity));
 }
示例#9
0
 public void AddConnection(Connection connection)
 {
     Schema.AddConnection(connection);
     connection.Visible = false;
 }
 public TextShapeDecoration(Connection decoratedShape)
     : base(decoratedShape)
 {
     TextSize = 12;
     parent = decoratedShape;
 }
 public abstract void Draw(StreamGeometryContext context, Connection connection);
 public virtual void CustomSetupConnectorEndPoint(Connection connection)
 {
     throw new System.InvalidOperationException("This class does not implement a custom Connector Endpoint Setup routine");
 }
示例#13
0
 public void RemoveConnection(Connection connection)
 {
     _Connections.Remove(connection);
 }
示例#14
0
 public void AddConnection(Connection connection)
 {
     if(_Connections.Contains(connection) == false)
         _Connections.Add(connection);
 }
 public void CustomSetupConnectorEndPoint(Connection connection)
 {
     connection.SourceCardinalityConverter = new InheritanceCardinalityConverter();
 }