ImageShape::OnPaintSelection Method (DiagramPaintEventArgs^)
Visual Studio 2015
Displays a selection highlight on the image.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)
Parameters
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);
}
Show: