void StopAutomationtechnology() { if (automationEngine == null) { return; // not started } automationEngine.Dispose(); automationEngine = null; automationtechnology = String.Empty; }
void StartAutomationtechnology(IntPtr rootWindow) { if (automationEngine != null) { return; // already started } if (automationtechnology.Equals("java", StringComparison.InvariantCultureIgnoreCase)) { automationEngine = new JavaAutomation(rootWindow, ApplicationName, localSession, LogWriter); } else if (automationtechnology.Equals("windows", StringComparison.InvariantCultureIgnoreCase)) { automationEngine = new UIAutomation(rootWindow, ApplicationName, localSession, LogWriter); } else { throw new Exception("Unknown Automation technology: " + automationtechnology); } }