Partager via


ImageShape.OnPaintSelection Method

Displays a selection highlight on the image.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Syntax

'Declaration
Public Overrides Sub OnPaintSelection ( _
    e As DiagramPaintEventArgs _
)
public override void OnPaintSelection(
    DiagramPaintEventArgs e
)
public:
virtual void OnPaintSelection(
    DiagramPaintEventArgs^ e
) override
abstract OnPaintSelection : 
        e:DiagramPaintEventArgs -> unit  
override OnPaintSelection : 
        e:DiagramPaintEventArgs -> unit
public override function OnPaintSelection(
    e : DiagramPaintEventArgs
)

Parameters

Remarks

Override this method to change how the image is displayed when this shape is selected. For example, you might want to display a different image.

The default behavior invokes the DoPaintSelection method of the ShapeGeometry property.

Examples

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 Security

See Also

Reference

ImageShape Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace