Table of Contents

Method GetAttributeForRole

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

GetAttributeForRole(VisualRole)

Gets the Attribute associated with a specified VisualRole from the Scheme.

Raises OnGettingAttributeForRole(in VisualRole, ref Attribute)/GettingAttributeForRole which can cancel the default behavior, and optionally change the attribute in the event args.

If Enabled is false, Disabled will be used instead of role. To override this behavior use OnGettingAttributeForRole(in VisualRole, ref Attribute)/GettingAttributeForRole to cancel the method, and return a different attribute.

If HighlightStates is not None and MouseState is In the Highlight will be used instead of role. To override this behavior use OnGettingAttributeForRole(in VisualRole, ref Attribute)/GettingAttributeForRole to cancel the method, and return a different attribute.

public Attribute GetAttributeForRole(VisualRole role)

Parameters

role VisualRole

The semantic VisualRole describing the element being rendered.

Returns

Attribute

The corresponding Attribute from the Scheme.