NodeShape.EnsureConnectionPoints 方法
若要設定頻率應該結束的連接器圖形的邊緣上的點會覆寫。
命名空間: Microsoft.VisualStudio.Modeling.Diagrams
組件: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll 中)
語法
'宣告
Public Overridable Sub EnsureConnectionPoints ( _
link As LinkShape _
)
public virtual void EnsureConnectionPoints(
LinkShape link
)
參數
備註
連接點是在周邊網路上的路由引擎會先將連接器接到圖案。如果沒有連接點時,連接器會附加任何一處圖形的邊緣。
覆寫這個方法,以設定圖形上的連接點。第一次連結連接到每個圖形的執行個體之前呼叫它。一旦設定特定圖形的執行個體的連接點,它們會套用至所有連線至該執行個體,無論連結類型。
連接點不會防止使用者移動接點的終點。如果您想要將連接器接到圖案的邊緣上的特定點,最好讓終止上非常小的透明連接埠 」 圖形有固定的位置,在其父圖案的接點。
範例
// Make sure that connection points are used:
public override bool HasConnectionPoints { get { return true; } }
// A connection point in the middle of each edge.
public override void EnsureConnectionPoints(LinkShape link)
{
RectangleD absoluteBoundingBox = this.AbsoluteBoundingBox;
CreateConnectionPoint(new PointD(absoluteBoundingBox.Center.X, absoluteBoundingBox.Bottom));
CreateConnectionPoint(new PointD(absoluteBoundingBox.Center.X, absoluteBoundingBox.Top));
CreateConnectionPoint(new PointD(absoluteBoundingBox.Left, absoluteBoundingBox.Center.Y));
CreateConnectionPoint(new PointD(absoluteBoundingBox.Right, absoluteBoundingBox.Center.Y));
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。