Exemplo n.º 1
0
        public Window ExpectingPopup(string name)
        {
            Application.DoEvents();
            Window popup   = null;
            string text    = "";
            int    retries = 3;

            while (text.ToLowerInvariant() != name.ToLowerInvariant() && retries-- > 0)
            {
                popup = this.WaitForPopup();
                if (popup != null)
                {
                    text = popup.GetWindowText();
                }
            }
            if (text.ToLowerInvariant() != name.ToLowerInvariant())
            {
                throw new ApplicationException(string.Format("Expecting popup '{0}'", name));
            }
            return(popup);
        }