Bagikan melalui


TablePattern.RowOrColumnMajorProperty Bidang

Definisi

RowOrColumnMajor Mengidentifikasi properti .

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

Nilai Bidang

Contoh

Dalam contoh berikut, elemen akar diteruskan ke fungsi yang mengembalikan kumpulan AutomationElement objek yang merupakan keturunan akar dan memenuhi serangkaian kondisi properti. Contoh ini mengambil AutomationElements yang mendukung TablePattern dan di mana RowOrColumnMajorProperty adalah Indeterminate atau ColumnMajor.

///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy 
/// the specified condition(s).
/// </summary>
/// <param name="targetApp">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying 
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
    AutomationElement targetApp)
{
    if (targetApp == null)
    {
        throw new ArgumentException("Root element cannot be null.");
    }

    PropertyCondition conditionSupportsTablePattern =
        new PropertyCondition(
        AutomationElement.IsTablePatternAvailableProperty, true);

    PropertyCondition conditionIndeterminateTraversal =
        new PropertyCondition(
        TablePattern.RowOrColumnMajorProperty,
        RowOrColumnMajor.Indeterminate);

    PropertyCondition conditionRowColumnTraversal =
        new PropertyCondition(
        TablePattern.RowOrColumnMajorProperty,
        RowOrColumnMajor.ColumnMajor);

    AndCondition conditionTable =
        new AndCondition(
        conditionSupportsTablePattern,
        new OrCondition(
        conditionIndeterminateTraversal,
        conditionRowColumnTraversal));

    return targetApp.FindAll(
        TreeScope.Descendants, conditionTable);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy 
''' the specified condition(s).
''' </summary>
''' <param name="targetApp">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying 
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal targetApp As AutomationElement) As AutomationElementCollection
    If targetApp Is Nothing Then
        Throw New ArgumentException("Root element cannot be null.")
    End If

    Dim conditionSupportsTablePattern As New PropertyCondition( _
    AutomationElement.IsTablePatternAvailableProperty, True)

    Dim conditionIndeterminateTraversal As New PropertyCondition( _
    TablePattern.RowOrColumnMajorProperty, RowOrColumnMajor.Indeterminate)

    Dim conditionRowColumnTraversal As New PropertyCondition( _
    TablePattern.RowOrColumnMajorProperty, RowOrColumnMajor.ColumnMajor)

    Dim conditionTable As New AndCondition( _
    conditionSupportsTablePattern, _
    New OrCondition(conditionIndeterminateTraversal, _
    conditionRowColumnTraversal))

    Return targetApp.FindAll(TreeScope.Descendants, conditionTable)

End Function 'FindAutomationElement

Keterangan

Pengidentifikasi ini digunakan oleh aplikasi klien Automation UI. Penyedia Automation UI harus menggunakan bidang yang setara di TablePatternIdentifiers.

Berlaku untuk

Lihat juga