/// <summary> /// Refresh PlatformPropertiesy /// </summary> private static void PopulatePlatformProperties(this A11yElement element) { try { var pp = element.Properties?.ById(PropertyType.UIA_NativeWindowHandlePropertyId); if (pp != null) { var handle = new IntPtr(pp.Value); element.PlatformProperties = new Dictionary <int, A11yProperty>(); element.AddWindowsExtendedStyleIntoPlatformProperties(handle); element.AddWindowsStyleIntoPlatformProperties(handle); } } catch (Exception) { } }
/// <summary> /// Refresh PlatformPropertiesy /// </summary> private static void PopulatePlatformProperties(this A11yElement element) { try { var pp = element.Properties?.ById(PropertyType.UIA_NativeWindowHandlePropertyId); if (pp != null) { var handle = new IntPtr(pp.Value); element.PlatformProperties = new Dictionary <int, A11yProperty>(); element.AddWindowsExtendedStyleIntoPlatformProperties(handle); element.AddWindowsStyleIntoPlatformProperties(handle); } } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) { e.ReportException(); } #pragma warning restore CA1031 // Do not catch general exception types }