Exemplo n.º 1
0
        public int WaitFor(params string[] matchers)
        {
            if (matchers.Length == 0)
            {
                throw new ArgumentException("matchers");
            }

            DateTime startTime = DateTime.Now;

            while (true)
            {
                if ((DateTime.Now - startTime).TotalMilliseconds > DefaultTimeout)
                {
                    throw new TimeoutException("Timed out waiting for " + matchers);
                }

                for (int i = 0; i < matchers.Length; i++)
                {
                    if (_client.Find(Encoding.ASCII.GetBytes(matchers[i])))
                    {
                        return(i);
                    }
                }
            }
        }