/// <summary> /// Gets the menu items contained in the current Menu Bar. /// </summary> /// <param name="extension">The extension.</param> /// <param name="control">The control.</param> /// <returns></returns> internal static AutomationElementCollection GetMenuItemsBridge(this ExpandCollapseAdapter extension, BaseProdControl control) { try { return(UiaGetMenuItems(control)); } catch (InvalidOperationException err) { throw new ProdOperationException(err.Message, err); } catch (ElementNotAvailableException err) { throw new ProdOperationException(err.Message, err); } }
/// <summary> /// Hides all descendant nodes, controls, or content of the AutomationElement. /// </summary> /// <example>this.Collapse(this);</example> public static void CollapseHook(this ExpandCollapseAdapter extension, BaseProdControl control) { try { UiaExpand(control); } catch (ArgumentNullException err) { throw new ProdOperationException(err); } catch (ElementNotAvailableException err) { throw new ProdOperationException(err); } catch (InvalidOperationException err) { //Note: Native throw new ProdOperationException(err); } }
/// <summary> /// Selects the menu item. /// </summary> /// <param name="extension">The extension.</param> /// <param name="control">The control.</param> /// <param name="itemPath">The item path, with each item down the path as an item in the list</param> /// <remarks> /// Menu item text MUST be exact (but not case-sensitive). 'Open' will not match an item 'Open...' but will match 'open' /// </remarks> internal static void SelectMenuItemBridge(this ExpandCollapseAdapter extension, BaseProdControl control, string[] itemPath) { _ctr = 0; try { UiaSelectMenuItem(control, itemPath); } catch (ArgumentNullException err) { throw new ProdOperationException(err); } catch (ElementNotAvailableException err) { throw new ProdOperationException(err); } catch (InvalidOperationException err) { throw new ProdOperationException(err); } }