共用方式為


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 安全性

請參閱

參考

ImageShape 類別

Microsoft.VisualStudio.Modeling.Diagrams 命名空間