AutomationPattern Klasa

Definicja

Identyfikuje wzorzec kontrolki.

public ref class AutomationPattern : System::Windows::Automation::AutomationIdentifier
public class AutomationPattern : System.Windows.Automation.AutomationIdentifier
type AutomationPattern = class
    inherit AutomationIdentifier
Public Class AutomationPattern
Inherits AutomationIdentifier
Dziedziczenie
AutomationPattern

Przykłady

Poniższy przykład przedstawia ProgrammaticName wzorce obsługiwane przez element AutomationElement.

W poniższym przykładzie pokazano, jak zażądać określonego wzorca.

/// <summary>
/// Retrieves the selection container for a selection item.
/// </summary>
/// <param name="listItem">
/// An element that supports SelectionItemPattern.
/// </param>
AutomationElement GetListItemParent(AutomationElement listItem)
{
    if (listItem == null) throw new ArgumentException();
    SelectionItemPattern pattern = listItem.GetCurrentPattern(SelectionItemPattern.Pattern) as SelectionItemPattern;
    if (pattern == null)
    {
        return null;
    }
    else
    {
        SelectionItemPattern.SelectionItemPatternInformation properties = pattern.Current;
        return properties.SelectionContainer;
    }
}
''' <summary>
''' Retrieves the selection container for a selection item.
''' </summary>
''' <param name="listItem">
''' An element that supports SelectionItemPattern.
''' </param>
Function GetListItemParent(ByVal listItem As AutomationElement) As AutomationElement
    If listItem Is Nothing Then
        Throw New ArgumentException()
    End If
    Dim pattern As SelectionItemPattern = _
        DirectCast(listItem.GetCurrentPattern(SelectionItemPattern.Pattern), SelectionItemPattern)
    If pattern Is Nothing Then
        Return Nothing
    Else
        Dim properties As SelectionItemPattern.SelectionItemPatternInformation = pattern.Current
        Return properties.SelectionContainer
    End If

End Function 'GetListItemParent

Uwagi

Wystąpienia tego typu identyfikują określone wzorce kontrolek. Na przykład DockPattern.Pattern pole identyfikuje wzorzec kontrolki DockPattern .

Właściwości

Id

Pobiera podstawowy identyfikator liczbowy.

(Odziedziczone po AutomationIdentifier)
ProgrammaticName

Pobiera zarejestrowaną nazwę programową.

(Odziedziczone po AutomationIdentifier)

Metody

CompareTo(Object)

Porównuje to AutomationIdentifier z innym AutomationIdentifierelementem .

(Odziedziczone po AutomationIdentifier)
Equals(Object)

Zwraca wartość wskazującą, czy podany AutomationIdentifier element jest odpowiednikiem tego AutomationIdentifierelementu .

(Odziedziczone po AutomationIdentifier)
GetHashCode()

Zwraca kod skrótu dla tego identyfikatora automatyzacja interfejsu użytkownika.

(Odziedziczone po AutomationIdentifier)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
LookupById(Int32)

Pobiera hermetyzację AutomationPattern określonego identyfikatora liczbowego.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Zobacz też