TextField.GetTextBrush Method
Gets the brush to draw the text with for the specified ShapeElement instance.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'Declaration
Public Overridable Function GetTextBrush ( _
view As DiagramClientView, _
parentShape As ShapeElement _
) As Brush
public virtual Brush GetTextBrush(
DiagramClientView view,
ShapeElement parentShape
)
public:
virtual Brush^ GetTextBrush(
DiagramClientView^ view,
ShapeElement^ parentShape
)
abstract GetTextBrush :
view:DiagramClientView *
parentShape:ShapeElement -> Brush
override GetTextBrush :
view:DiagramClientView *
parentShape:ShapeElement -> Brush
public function GetTextBrush(
view : DiagramClientView,
parentShape : ShapeElement
) : Brush
Parameters
- parentShape
Type: Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement
The ShapeElement on which to draw.
Return Value
Type: System.Drawing.Brush
Remarks
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;
}
.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.