ImageShape.OnPaintSelection 方法
在影像上顯示選取範圍反白顯示。
命名空間: Microsoft.VisualStudio.Modeling.Diagrams
組件: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll 中)
語法
'宣告
Public Overrides Sub OnPaintSelection ( _
e As DiagramPaintEventArgs _
)
public override void OnPaintSelection(
DiagramPaintEventArgs e
)
參數
備註
覆寫這個方法會變更影像的顯示方式,在這個圖案時。 例如,您可能想要顯示不同的影像。
預設行為會叫用 ShapeGeometry 屬性的 DoPaintSelection 方法。
範例
public override void OnPaintSelection(DiagramPaintEventArgs e)
{
DiagramItem thisItem = new DiagramItem(this);
bool isSelected = e.View.Selection.Contains(thisItem);
bool isPrimary = thisItem.Equals(e.View.Selection.PrimaryItem);
bool isFocused = e.View.Selection.Count > 1
&& thisItem.Equals(e.View.Selection.FocusedItem);
this.ShapeGeometry.DoPaintSelection(e, this, isSelected, isFocused, isPrimary);
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。