ImageShape.OnPaintSelection Method
Displays a selection highlight on the image.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'Declaração
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(DiagramPaintEventArgs, IGeometryHost, Boolean, Boolean, Boolean) 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.