InvokePattern.Pattern Campo
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Identifica il pattern di controllo InvokePattern.
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
Nell'esempio seguente viene ottenuto un InvokePattern pattern di controllo da un controllo e viene chiamato il Invoke metodo .
///--------------------------------------------------------------------
/// <summary>
/// Obtains an InvokePattern control pattern from a control
/// and calls the InvokePattern.Invoke() method on the control.
/// </summary>
/// <param name="targetControl">
/// The control of interest.
/// </param>
///--------------------------------------------------------------------
private void InvokeControl(AutomationElement targetControl)
{
InvokePattern invokePattern = null;
try
{
invokePattern =
targetControl.GetCurrentPattern(InvokePattern.Pattern)
as InvokePattern;
}
catch (ElementNotEnabledException)
{
// Object is not enabled
return;
}
catch (InvalidOperationException)
{
// object doesn't support the InvokePattern control pattern
return;
}
invokePattern.Invoke();
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains an InvokePattern control pattern from a control
''' and calls the InvokePattern.Invoke() method on the control.
''' </summary>
''' <param name="targetControl">
''' The control of interest.
''' </param>
'''--------------------------------------------------------------------
Private Sub InvokeControl(ByVal targetControl As AutomationElement)
Dim invokePattern As InvokePattern = Nothing
Try
invokePattern = _
DirectCast(targetControl.GetCurrentPattern(invokePattern.Pattern), _
InvokePattern)
Catch e As ElementNotEnabledException
' Object is not enabled.
Return
Catch e As InvalidOperationException
' Object doesn't support the InvokePattern control pattern
Return
End Try
invokePattern.Invoke()
End Sub
Questo identificatore viene usato dalle applicazioni client di automazione interfaccia utente. I provider di automazione interfaccia utente devono usare il campo equivalente in InvokePatternIdentifiers.
L'identificatore del modello viene passato a metodi quali GetCurrentPattern per recuperare il pattern di controllo di interesse dall'oggetto specificato AutomationElement.
Prodotto | Versioni |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Feedback su .NET
.NET è un progetto open source. Seleziona un collegamento per fornire feedback: