public static GuiTextBox GetTextBox(AutomationElement window, string automationId) { if (_cachedtb == null || _cachedtb.AutomationId != automationId) { var tb = window.FindChildByControlTypeAndAutomationId(ControlType.Edit, automationId); _cachedtb = new GuiTextBox(tb); } return _cachedtb; }
public static void InvalidateCache() { _cachedtb = null; }
public static GuiTextBox GetTextBoxByName(AutomationElement window, string name) { if (_cachedtb == null || _cachedtb.Name != name) { var tb = window.FindChildByControlTypeAndName(ControlType.Edit, name); _cachedtb = new GuiTextBox(tb); } return _cachedtb; }