/// <summary> /// Gets the URL associated to a browser tab, given the IAccessible /// corresponding to that tab. /// </summary> /// <param name='tab'>an IAccessible corresponding to the /// IE browser tab.</param> /// <returns>a string, the URL being displayed in the tab.</returns> /// <remarks> /// <para> /// This is used to aid in determining which tab to activate. /// </para> /// </remarks> private static string UrlForTab(IAccessible tab) { try { var desc = tab.get_accDescription(0); if (desc != null) { if (desc.Contains("\n")) { string url = desc.Substring(desc.IndexOf("\n")).Trim(); return(url); } else { return(desc); } } } catch { } return("??"); }
string?IAccessibleInternal.get_accDescription(object childID) => publicIAccessible.get_accDescription(childID);
private static string GetDescription(IAccessible acc, int idChild) { try { return FixBstr(acc.get_accDescription(idChild)); } catch (Exception e) { if (HandleIAccessibleException(e)) { throw; } return ""; } }
string UnsafeNativeMethods.IAccessibleInternal.get_accDescription(object childID) { IntSecurity.UnmanagedCode.Assert(); return(publicIAccessible.get_accDescription(childID)); }