This documentation is archived and is not being maintained.

NodeShape.GetCompliantAnchorPoint Method

Gets a new, legal anchor point for the shape.

Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in microsoft.visualstudio.modeling.diagrams.dll)

public virtual PointD GetCompliantAnchorPoint (
	AnchorPoint anchorPoint,
	PointD proposedAnchorPoint
)
public PointD GetCompliantAnchorPoint (
	AnchorPoint anchorPoint, 
	PointD proposedAnchorPoint
)
public function GetCompliantAnchorPoint (
	anchorPoint : AnchorPoint, 
	proposedAnchorPoint : PointD
) : PointD

Parameters

anchorPoint

The current anchor point for the shape.

proposedAnchorPoint

The proposed anchor point for the shape.

Return Value

The new, legal anchor point for the shape.

public override DslDiagrams::PointD GetCompliantAnchorPoint(Microsoft.VisualStudio.Modeling.Diagrams.AnchorPoint anchorPoint, Microsoft.VisualStudio.Modeling.Diagrams.PointD proposedAnchorPoint)
{
    // anchor point can only be in the left or right edges of a lifeline
    DslDiagrams::PointD newAnchorPoint = this.AbsoluteBoundingBox.PerimeterTranslation(proposedAnchorPoint);
    newAnchorPoint.X = anchorPoint.AnchorPointLocation.X;

    return newAnchorPoint;
}
Show: