public static GuiTabItem GetTabByName(AutomationElement parentWindow, string name) { if (_cachedTab == null || _cachedTab.AutomationId != name) { var res = parentWindow.FindChildByControlTypeAndName(ControlType.TabItem, name); _cachedTab = new GuiTabItem(res, name); _currentParentWindow = parentWindow; } return _cachedTab; }
public override void GetThisWindow() { _cachedTab = GetTabByAutomationId(_currentParentWindow, AutomationId); }
public static void InvalidateCache() { _cachedTab = null; }