TablePattern.RowOrColumnMajorProperty Feld

Definition

Gibt die RowOrColumnMajor-Eigenschaft an.Identifies the RowOrColumnMajor property.

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 

Feldwert

AutomationProperty

Beispiele

Im folgenden Beispiel wird ein root-Element an eine Funktion übermittelt, die eine Auflistung von-Objekten zurückgibt, die Nachfolger des Stamms AutomationElement sind und einen Satz von Eigenschafts Bedingungen erfüllen.In the following example, a root element is passed to a function that returns a collection of AutomationElement objects that are descendants of the root and satisfy a set of property conditions. In diesem Beispiel werden die AutomationElement s abgerufen, die unterstützen, TablePattern und der RowOrColumnMajorProperty ist entweder Indeterminate oder ColumnMajor .This example retrieves the AutomationElements that support TablePattern and where the RowOrColumnMajorProperty is either Indeterminate or 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

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierungs-Client Anwendungen verwendet.This identifier is used by UI Automation client applications. Benutzeroberflächenautomatisierungs-Anbieter sollten das entsprechende Feld in verwenden TablePatternIdentifiers .UI Automation providers should use the equivalent field in TablePatternIdentifiers.

Gilt für: