本文整理汇总了C#中System.Windows.Automation.Provider.IInvokeProvider.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# IInvokeProvider.Invoke方法的具体用法?C# IInvokeProvider.Invoke怎么用?C# IInvokeProvider.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了IInvokeProvider.Invoke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: if
/// <summary>
/// Responds to an InvokePattern.Invoke by simulating a MouseDown event.
/// </summary>
/// <remarks>
/// ProviderControl is a button control object that also implements
/// IRawElementProviderSimple.
/// </remarks>
void IInvokeProvider.Invoke()
{
// If the control is not enabled, we're responsible for letting UIAutomation know.
// It catches the exception and then throws it to the client.
if (false == (bool)rawElementProvider.GetPropertyValue(AutomationElementIdentifiers.IsEnabledProperty.Id))
{
throw new ElementNotEnabledException();
}
// Create arguments for the event. The parameters aren't used.
MouseEventArgs mouseArgs = new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0);
// Invoke the MouseDown handler. We cannot call MyControl_MouseDown directly,
// because it is illegal to update the UI from a different thread.
MouseEventHandler onMouseEvent = ProviderControl.RootButtonControl_MouseDown;
ProviderControl.BeginInvoke(onMouseEvent, new object[] { this, mouseArgs });
}
}