public static GuiButton GetButton(AutomationElement window, string name) { AutomationElement res; if (name == "Close") res = window.FindChildByControlTypeAndAutomationIdAndName(ControlType.Button, "button", name); else res = window.FindChildByControlTypeAndName(ControlType.Button, name); return new GuiButton(res, name); }
public static GuiMenuItem GetMenuItem(AutomationElement window, string name) { AutomationElement res; if (name == "Close") res = window.FindChildByControlTypeAndAutomationIdAndName(ControlType.MenuItem, "menuitem", name); else res = window.FindChildByControlTypeAndName(ControlType.MenuItem, name); return new GuiMenuItem(res); }