Share via


TableItemPattern.Pattern Campo

Definizione

Identifica il pattern di controllo TableItemPattern.

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 

Valore del campo

Esempio

Nell'esempio seguente viene ottenuto un TableItemPattern pattern di controllo da un oggetto AutomationElement.

///--------------------------------------------------------------------
/// <summary>
/// Obtains a TableItemPattern control pattern from an 
/// AutomationElement.
/// </summary>
/// <param name="targetControl">
/// The AutomationElement of interest.
/// </param>
/// <returns>
/// A TableItemPattern object.
/// </returns>
///--------------------------------------------------------------------
private TableItemPattern GetTableItemPattern(
    AutomationElement targetControl)
{
    TableItemPattern tableItemPattern = null;

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

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

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

    Return tableItemPattern

End Function 'GetTableItemPattern

Commenti

Questo identificatore viene usato da Automazione interfaccia utente applicazioni client. Automazione interfaccia utente provider devono usare il campo equivalente in TableItemPatternIdentifiers.

L'identificatore del modello viene passato a metodi quali GetCurrentPattern per recuperare il pattern di controllo di interesse dall'oggetto specificato AutomationElement.

Si applica a

Vedi anche