Aracılığıyla paylaş


SelectionItemPattern.IsSelectedProperty Alan

Tanım

Özelliğini tanımlar IsSelected .

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

Alan Değeri

AutomationProperty

Örnekler

Aşağıdaki örnekte kök öğesi, kökün alt öğeleri olan ve bir dizi özellik koşulunu karşılayan UI Otomasyonu öğe koleksiyonunu döndüren bir işleve geçirilir.

///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy 
/// the specified condition(s).
/// </summary>
/// <param name="rootElement">
/// 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 rootElement)
{
    if (rootElement == null)
    {
        throw new ArgumentException("Root element cannot be null.");
    }

    PropertyCondition conditionIsSelected =
        new PropertyCondition(
        SelectionItemPattern.IsSelectedProperty, false);

    return rootElement.FindAll(
        TreeScope.Descendants, conditionIsSelected);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy 
''' the specified condition(s).
''' </summary>
''' <param name="rootElement">
''' 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 rootElement As AutomationElement) As AutomationElementCollection
    If rootElement Is Nothing Then
        Throw New ArgumentException("Root element cannot be null.")
    End If

    Dim conditionIsSelected As New PropertyCondition( _
    SelectionItemPattern.IsSelectedProperty, False)

    Return rootElement.FindAll(TreeScope.Descendants, conditionIsSelected)
End Function 'FindAutomationElement

Açıklamalar

Bu tanımlayıcı, UI Otomasyonu istemci uygulamaları tarafından kullanılır. UI Otomasyonu sağlayıcıları içindeki eşdeğer alanı SelectionItemPatternIdentifierskullanmalıdır.

Şunlara uygulanır