ImageShape.OnPaintSelection 方法
顯示影像的選取範圍反白顯示。
命名空間: Microsoft.VisualStudio.Modeling.Diagrams
組件: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll 中)
語法
'宣告
Public Overrides Sub OnPaintSelection ( _
e As DiagramPaintEventArgs _
)
public override void OnPaintSelection(
DiagramPaintEventArgs e
)
參數
備註
覆寫這個方法,以變更此圖形選取時,如何顯示的影像。例如,您可以顯示不同的圖像。
預設行為會叫用DoPaintSelection方法的ShapeGeometry屬性。
範例
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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。