Beispiel #1
0
 public static void RaiseAutomationEvent(AutomationEvent eventId, IRawElementProviderSimple provider, AutomationEventArgs e)
 {
     AutomationInteropProvider.ValidateArgumentNonNull(eventId, "eventId");
     AutomationInteropProvider.ValidateArgumentNonNull(provider, "provider");
     AutomationInteropProvider.ValidateArgumentNonNull(e, "e");
     if (e.EventId == AutomationElementIdentifiers.AsyncContentLoadedEvent)
     {
         AsyncContentLoadedEventArgs asyncContentLoadedEventArgs = e as AsyncContentLoadedEventArgs;
         if (asyncContentLoadedEventArgs == null)
         {
             AutomationInteropProvider.ThrowInvalidArgument("e");
         }
         UiaCoreProviderApi.UiaRaiseAsyncContentLoadedEvent(provider, asyncContentLoadedEventArgs.AsyncContentLoadedState, asyncContentLoadedEventArgs.PercentComplete);
         return;
     }
     if (e.EventId == WindowPatternIdentifiers.WindowClosedEvent && !(e is WindowClosedEventArgs))
     {
         AutomationInteropProvider.ThrowInvalidArgument("e");
     }
     UiaCoreProviderApi.UiaRaiseAutomationEvent(provider, eventId.Id);
 }
Beispiel #2
0
 public static IRawElementProviderSimple HostProviderFromHandle(IntPtr hwnd)
 {
     AutomationInteropProvider.ValidateArgument(hwnd != IntPtr.Zero, "HwndMustBeNonNULL");
     return(UiaCoreProviderApi.UiaHostProviderFromHwnd(hwnd));
 }
Beispiel #3
0
 public static void RaiseStructureChangedEvent(IRawElementProviderSimple provider, StructureChangedEventArgs e)
 {
     AutomationInteropProvider.ValidateArgumentNonNull(provider, "provider");
     AutomationInteropProvider.ValidateArgumentNonNull(e, "e");
     UiaCoreProviderApi.UiaRaiseStructureChangedEvent(provider, e.StructureChangeType, e.GetRuntimeId());
 }
Beispiel #4
0
 public static void RaiseAutomationPropertyChangedEvent(IRawElementProviderSimple element, AutomationPropertyChangedEventArgs e)
 {
     AutomationInteropProvider.ValidateArgumentNonNull(element, "element");
     AutomationInteropProvider.ValidateArgumentNonNull(e, "e");
     UiaCoreProviderApi.UiaRaiseAutomationPropertyChangedEvent(element, e.Property.Id, e.OldValue, e.NewValue);
 }
Beispiel #5
0
 public static IntPtr ReturnRawElementProvider(IntPtr hwnd, IntPtr wParam, IntPtr lParam, IRawElementProviderSimple el)
 {
     AutomationInteropProvider.ValidateArgument(hwnd != IntPtr.Zero, "HwndMustBeNonNULL");
     AutomationInteropProvider.ValidateArgumentNonNull(el, "el");
     return(UiaCoreProviderApi.UiaReturnRawElementProvider(hwnd, wParam, lParam, el));
 }