Partager via


ImageShape.OnPaintSelection, méthode

Affiche une surbrillance de sélection sur l'image.

Espace de noms :  Microsoft.VisualStudio.Modeling.Diagrams
Assembly :  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (dans Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)

Syntaxe

'Déclaration
Public Overrides Sub OnPaintSelection ( _
    e As DiagramPaintEventArgs _
)
public override void OnPaintSelection(
    DiagramPaintEventArgs e
)

Paramètres

Notes

Substituez cette méthode pour modifier comment l'image est affichée lorsque cette forme est sélectionnée.Par exemple, vous pouvez souhaiter afficher une image différente.

Le comportement par défaut appelle la méthode d'DoPaintSelection de propriété d'ShapeGeometry.

Exemples

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

Sécurité .NET Framework

Voir aussi

Référence

ImageShape Classe

Microsoft.VisualStudio.Modeling.Diagrams, espace de noms