protected virtual string WaitForCartesMethodValue(RPAComponent component, string method, int seconds) /* It waits until the indicated method has * value and returns it. Once the waiting time has been exceeded, it throws an exception. */ { RPAParameters parameters = new RPAParameters(); DateTime timeout; string result; try { timeout = DateTime.Now.AddSeconds(seconds); do { CheckAbort(); cartes.reset(component.api()); Thread.Sleep(400); if (timeout < DateTime.Now) { throw new Exception("Timeout"); } else { result = ToString(component.Execute(method, parameters)); } } while (result.Length == 0); return(result); } catch (Exception e) { forensic("MyCartes::WaitForCartesMethodValue", e); throw; } }
protected abstract string getProjectId(); // Returns the ID of the loaded project in Cartes. If Cartes does not have a loaded project, it returns the empty string. protected virtual void reset(RPAComponent component) // Reset the API of te component { cartes.reset(component.api()); }