RangeValuePattern.Pattern Feld

Definition

Bezeichnet das RangeValuePattern-Steuerelementmuster.Identifies the RangeValuePattern 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 RangeValuePattern -Steuerelement Muster aus einem AutomationElementabgerufen.In the following example, a RangeValuePattern control pattern is obtained from an AutomationElement.

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

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

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

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

    Return rangeValuePattern

End Function 'GetRangeValuePattern    

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

Der Muster Bezeichner wird an Methoden wie z GetCurrentPattern . b. zurückgegeben, um das gewünschte Steuer AutomationElementElement Muster aus dem angegebenen abzurufen.The pattern identifier is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.

Gilt für: