public abstract void DockAt(Port port);
public Vertex(Port port) { Port = port; }
public override Vector GetPortStalkPosition(Port port) { return GetPortPosition(port); }
public override Vector GetPortPosition(Port port) { var vertexPort = (VertexPort) port; return vertexPort.Vertex.Position; }
public override void DockAt(Port port) { Vertex.Port = port; Connection.RaiseChanged(); }
public override Vector GetPortStalkPosition(Port port) { var outerBounds = InnerBounds; outerBounds.Inflate(Settings.ConnectionStalkLength); var compass = (CompassPort)port; Vector inner = InnerBounds.GetCorner(compass.CompassPoint); Vector outer = outerBounds.GetCorner(compass.CompassPoint); switch (compass.CompassPoint) { case CompassPoint.EastNorthEast: case CompassPoint.EastSouthEast: case CompassPoint.WestNorthWest: case CompassPoint.WestSouthWest: return new Vector(outer.X, inner.Y); case CompassPoint.NorthNorthEast: case CompassPoint.NorthNorthWest: case CompassPoint.SouthSouthEast: case CompassPoint.SouthSouthWest: return new Vector(inner.X, outer.Y); default: return outer; } }
public override Vector GetPortPosition(Port port) { // map the compass points onto our bounding rectangle var compass = (CompassPort)port; return InnerBounds.GetCorner(compass.CompassPoint); }