TextField::GetTextBrushId Method (DiagramClientView^, ShapeElement^)
Visual Studio 2015
Gets the id of the brush to draw the text with for the specified ShapeElement instance.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)
public: virtual StyleSetResourceId^ GetTextBrushId( DiagramClientView^ view, ShapeElement^ parentShape )
Parameters
- parentShape
-
Type:
Microsoft.VisualStudio.Modeling.Diagrams::ShapeElement^
The ShapeElement on which to draw.
Return Value
Type: Microsoft.VisualStudio.Modeling.Diagrams::StyleSetResourceId^By default, this method returns the default text brush id. To dynamically change the text brush for this ShapeField, override this method.
public virtual StyleSetResourceId GetTextBrushId(DiagramClientView view, ShapeElement parentShape)
{
if (this.HasSelectedAppearance(parentShape, view))
{
return view.Focused ? this.DefaultSelectedTextBrushId : this.DefaultInactiveSelectedTextBrushId;
}
return DefaultTextBrushId;
}
Show: