private static WindowInteractionState UiaGetWindowState(ProdWindow baseControl) { WindowInteractionState state = WindowPatternHelper.GetInteractionState(baseControl.UIAElement); LogController.ReceiveLogMessage(new LogMessage(state.ToString())); return(state); }
public static void AssertReadyForUserInteraction(AutomationElement element) { WindowPattern currentPattern = AutomationPatternHelper.GetWindowPattern(element); WindowInteractionState windowInteractionState = currentPattern.Current.WindowInteractionState; if (windowInteractionState != WindowInteractionState.ReadyForUserInteraction) { throw new Exception(string.Format("Window is not ready for user interaction. State is {0}. ({1})", windowInteractionState.ToString(), element.ToString())); } }