private static int NativeSelectedIndex(BaseProdControl control) { if (control.UIAElement.Current.ControlType == ControlType.ComboBox) { return(ProdComboBoxNative.GetSelectedIndexNative((IntPtr)control.UIAElement.Current.NativeWindowHandle)); } return(ProdListBoxNative.GetSelectedIndexNative((IntPtr)control.UIAElement.Current.NativeWindowHandle)); }
private static bool NativeIsItemSelected(BaseProdControl control, int index) { int selectedIndex; if (control.UIAElement.Current.ControlType == ControlType.ComboBox) { selectedIndex = ProdComboBoxNative.GetSelectedIndexNative((IntPtr)control.UIAElement.Current.NativeWindowHandle); } else { selectedIndex = ProdTabNative.GetSelectedTab((IntPtr)control.UIAElement.Current.NativeWindowHandle); } return(selectedIndex == index); }