Share via


TablePattern.RowHeadersProperty フィールド

定義

テーブルの行ヘッダーのコレクションを取得するプロパティを識別します。

public: static initonly System::Windows::Automation::AutomationProperty ^ RowHeadersProperty;
public static readonly System.Windows.Automation.AutomationProperty RowHeadersProperty;
 staticval mutable RowHeadersProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly RowHeadersProperty As AutomationProperty 

フィールド値

次の例では、テーブルの AutomationElement プライマリ行または列ヘッダーを表す オブジェクトの配列を取得します。

この例では、 プロパティと行ヘッダー項目と列ヘッダー項目の間 RowOrColumnMajor のリレーションシップを示します。 ただし、テーブルの プロパティに関係なく RowOrColumnMajor 、テーブルに行ヘッダーと列ヘッダーを含めることができます。

///--------------------------------------------------------------------
/// <summary>
/// Obtains an array of primary table headers.
/// </summary>
/// <param name="targetControl">
/// The target control of interest.
/// </param>
/// <param name="roworcolumnMajor">
/// The RowOrColumnMajor specifier.
/// </param>
/// <returns>
/// An array of automation elements.
/// </returns>
///--------------------------------------------------------------------
private AutomationElement[] GetPrimaryHeaders(
    AutomationElement targetControl, RowOrColumnMajor roworcolumnMajor)
{
    if (targetControl == null)
    {
        throw new ArgumentException("Target element cannot be null.");
    }

    try
    {
        if (roworcolumnMajor ==
            RowOrColumnMajor.RowMajor)
        {
            return targetControl.GetCurrentPropertyValue(
                TablePattern.RowHeadersProperty) as AutomationElement[];
        }

        if (roworcolumnMajor ==
            RowOrColumnMajor.ColumnMajor)
        {
            return targetControl.GetCurrentPropertyValue(
                TablePattern.ColumnHeadersProperty) as AutomationElement[];
        }
    }
    catch (InvalidOperationException)
    {
        // TablePattern not supported.
        // TO DO: error processing.
    }

    return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains an array of primary table headers.
''' </summary>
''' <param name="targetControl">
''' The target control of interest.
''' </param>
''' <param name="roworcolumnMajor">
''' The RowOrColumnMajor specifier.
''' </param>
''' <returns>
''' Automation element array objects.
''' </returns>
'''--------------------------------------------------------------------
Private Overloads Function GetPrimaryHeaders( _
ByVal targetControl As AutomationElement, _
ByVal roworcolumnMajor As RowOrColumnMajor) As AutomationElement()
    If targetControl Is Nothing Then
        Throw New ArgumentException("Target element cannot be null.")
    End If

    Try
        If roworcolumnMajor = roworcolumnMajor.RowMajor Then
            Return DirectCast(targetControl.GetCurrentPropertyValue( _
            TablePattern.RowHeadersProperty), AutomationElement())
        End If

        If roworcolumnMajor = roworcolumnMajor.ColumnMajor Then
            Return DirectCast(targetControl.GetCurrentPropertyValue( _
            TablePattern.ColumnHeadersProperty), AutomationElement())
        End If
    Catch exc As InvalidOperationException
        ' TablePattern not supported.
        ' TO DO: error processing.
    End Try

    Return Nothing

End Function 'GetPrimaryHeaders

注釈

この識別子は、UI オートメーションクライアント アプリケーションによって使用されます。 UI オートメーション プロバイダーでは、 でTablePatternIdentifiers同等のフィールドを使用する必要があります。

返されるヘッダーの順序はプロバイダー内で一貫していますが、プロバイダー間で一貫性があるわけではありません。

このプロパティは にTablePattern.TablePatternInformation存在せず、 または GetCachedPropertyValueを使用GetCurrentPropertyValueして取得する必要があります。

適用対象

こちらもご覧ください