DockPattern.Pattern DockPattern.Pattern DockPattern.Pattern DockPattern.Pattern Field

Definition

Bezeichnet das DockPattern-Steuerelementmuster.Identifies the DockPattern control pattern.

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

Feldwert

Beispiele

Im folgenden Beispiel wird ein DockPattern -Steuerelement Muster aus einem AutomationElementabgerufen.In the following example, a DockPattern control pattern is obtained from an AutomationElement.

///--------------------------------------------------------------------
/// <summary>
/// Obtains a DockPattern control pattern from an 
/// automation element.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// A DockPattern object.
/// </returns>
///--------------------------------------------------------------------
private DockPattern GetDockPattern(
    AutomationElement targetControl)
{
    DockPattern dockPattern = null;

    try
    {
        dockPattern =
            targetControl.GetCurrentPattern(
            DockPattern.Pattern)
            as DockPattern;
    }
    // Object doesn't support the DockPattern control pattern
    catch (InvalidOperationException)
    {
        return null;
    }

    return dockPattern;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains a DockPattern control pattern from an 
''' automation element.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' A DockPattern object.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetDockPattern( _
ByVal targetControl As AutomationElement) As DockPattern
    Dim dockPattern As DockPattern = Nothing

    Try
        dockPattern = DirectCast( _
        targetControl.GetCurrentPattern(dockPattern.Pattern), _
        DockPattern)
    Catch exc As InvalidOperationException
        ' Object doesn't support the DockPattern control pattern
        Return Nothing
    End Try

    Return dockPattern

End Function 'GetDockPattern    

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 DockPatternIdentifiersFeld in verwenden.UI Automation providers should use the equivalent field in DockPatternIdentifiers.

Das Muster Bezeichner (identifier; ID)identifier (ID) wird an Methoden GetCurrentPattern wie z. b. zurückgegeben, um das gewünschte Steuerelement AutomationElementMuster aus dem angegebenen abzurufen.The pattern Bezeichner (identifier; ID)identifier (ID) is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.

Gilt für: