ImageShape::OnPaintSelection Method (DiagramPaintEventArgs^)

 

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)

public:
virtual void OnPaintSelection(
	DiagramPaintEventArgs^ e
) override

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.


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);
}

Return to top
Show: