Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Displays a selection highlight on the image.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.