TextField::GetTextBrush Method (DiagramClientView^, ShapeElement^)

 

Gets the brush to draw the text with for the specified ShapeElement instance.

Namespace:   Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

public:
virtual Brush^ GetTextBrush(
	DiagramClientView^ view,
	ShapeElement^ parentShape
)

Return Value

Type: System.Drawing::Brush^

By default, this method returns the default text brush of this ShapeField. To dynamically change the text brush for this ShapeField, consider overriding GetTextBrushId first. If that method is inadequate, override this method.

public virtual Brush GetTextBrush(DiagramClientView view, ShapeElement parentShape)
{
StyleSet parentStyleSet = (parentShape != null) ? parentShape.StyleSet : null;

return (parentStyleSet != null)
? parentStyleSet.GetBrush(GetTextBrushId(view, parentShape))
: null;
}

Return to top
Show: