public static void RaiseAutomationEvent(AutomationEvent eventId, IRawElementProviderSimple provider, AutomationEventArgs e)
 {
     Utility.ValidateArgumentNonNull(eventId, "eventId");
     Utility.ValidateArgumentNonNull(provider, "provider");
     Utility.ValidateArgumentNonNull(e, "e");
     if (e.EventId == AutomationElementIdentifiers.AsyncContentLoadedEvent)
     {
         AsyncContentLoadedEventArgs args = e as AsyncContentLoadedEventArgs;
         if (args == null)
         {
             throw new ArgumentException("e");
         }
         UiaCoreProviderApi.UiaRaiseAsyncContentLoadedEvent(provider, args.AsyncContentLoadedState, args.PercentComplete);
     }
     else
     {
         if ((e.EventId == WindowPatternIdentifiers.WindowClosedEvent) && !(e is WindowClosedEventArgs))
         {
             throw new ArgumentException("e");
         }
         UiaCoreProviderApi.UiaRaiseAutomationEvent(provider, eventId.Id);
     }
 }
 public static IntPtr ReturnRawElementProvider(IntPtr hwnd, IntPtr wParam, IntPtr lParam, IRawElementProviderSimple el)
 {
     Utility.ValidateArgument(hwnd != IntPtr.Zero, "HWND must not be null");
     Utility.ValidateArgumentNonNull(el, "el");
     return(UiaCoreProviderApi.UiaReturnRawElementProvider(hwnd, wParam, lParam, el));
 }
 public static void RaiseStructureChangedEvent(IRawElementProviderSimple provider, StructureChangedEventArgs e)
 {
     Utility.ValidateArgumentNonNull(provider, "provider");
     Utility.ValidateArgumentNonNull(e, "e");
     UiaCoreProviderApi.UiaRaiseStructureChangedEvent(provider, (UIAutomationClient.StructureChangeType)e.StructureChangeType, e.GetRuntimeId());
 }
 public static void RaiseAutomationPropertyChangedEvent(IRawElementProviderSimple element, AutomationPropertyChangedEventArgs e)
 {
     Utility.ValidateArgumentNonNull(element, "element");
     Utility.ValidateArgumentNonNull(e, "e");
     UiaCoreProviderApi.UiaRaiseAutomationPropertyChangedEvent(element, e.Property.Id, e.OldValue, e.NewValue);
 }
 public static IRawElementProviderSimple HostProviderFromHandle(IntPtr hwnd)
 {
     Utility.ValidateArgument(hwnd != IntPtr.Zero, "HWND must not be null");
     return(UiaCoreProviderApi.UiaHostProviderFromHwnd(hwnd));
 }