public static void StopPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement) { var key = findElement.GetMetaInfos()["id"] + clickElement.GetMetaInfos()["id"]; PopupWatcher watcher = null; if (watchers.TryGetValue(key, out watcher)) { StopPopupWatcher(key, watcher); } else { Report.Warn("The popup watcher you tried to remove does not exist."); } }
public static PopupWatcher StartPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement) { var key = findElement.GetMetaInfos()["id"] + clickElement.GetMetaInfos()["id"]; if (watchers.ContainsKey(key)) { throw new ArgumentException("Popup watcher with given parameters already exists."); } var watcher = new PopupWatcher(); watcher.WatchAndClick(findElement, clickElement); watcher.Start(); watchers.Add(key, watcher); Report.Info("Popup watcher started."); return(watcher); }
public static PopupWatcher PauseWhileExists(RepoItemInfo findElement) { CheckArgumentNotNull(findElement, "findElement"); var key = findElement.GetMetaInfos()["id"]; if (watchers.ContainsKey(key)) { throw new ArgumentException("Popup watcher with given parameters already exists."); } var watcher = new PopupWatcher(); watcher.Watch(findElement, RequestPauseWhileExists); watcher.Start(); watchers.Add(key, watcher); Report.Info(string.Format("Started watching for '{0}'.", findElement.FullName)); return(watcher); }