Freigeben über


TextField.GetTextBrushId Method

Gets the id of 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 GetTextBrushId ( _
    view As DiagramClientView, _
    parentShape As ShapeElement _
) As StyleSetResourceId
public virtual StyleSetResourceId GetTextBrushId(
    DiagramClientView view,
    ShapeElement parentShape
)
public:
virtual StyleSetResourceId^ GetTextBrushId(
    DiagramClientView^ view, 
    ShapeElement^ parentShape
)
abstract GetTextBrushId : 
        view:DiagramClientView * 
        parentShape:ShapeElement -> StyleSetResourceId 
override GetTextBrushId : 
        view:DiagramClientView * 
        parentShape:ShapeElement -> StyleSetResourceId 
public function GetTextBrushId(
    view : DiagramClientView, 
    parentShape : ShapeElement
) : StyleSetResourceId

Parameters

Return Value

Type: Microsoft.VisualStudio.Modeling.Diagrams.StyleSetResourceId

Remarks

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;
}

.NET Framework Security

See Also

Reference

TextField Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace