Поделиться через


ITextRangeProvider.GetAttributeValue Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Retrieves the value of the specified attribute ID across the text range.

Namespace:  System.Windows.Automation.Provider
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Function GetAttributeValue ( _
    attributeId As Integer _
) As Object
Object GetAttributeValue(
    int attributeId
)

Parameters

Return Value

Type: System.Object
Retrieves an object that represents the value of the specified attribute. See Remarks.

Exceptions

Exception Condition
ArgumentException

The specified attribute ID is not valid.

Remarks

This method returns results where the returned value varies, depending on which attribute ID is requested. For example, GetAttributeValue(TextPattern.FontNameAttribute) returns a string that represents the font name of the text range, GetAttributeValue(TextPattern.IsItalicAttribute) returns a value of type Boolean, and so on.

This method returns MixedAttributeValue if the value of the specified attribute varies over the text range.

This method returns NotSupported if the specified attribute is not supported by the provider or the control.

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.