Пример #1
0
        public int WaitForDialogToAppear(string t)
        {
            WaitForDialogToAppearObj wait_client = new WaitForDialogToAppearObj(this, t);
            int  timeout  = 5 * 1000;       // 30 seconds
            int  interval = 250;            // .5 second
            int  elapsed;
            bool success;


            Tracing.WriteLine("max time to wait: {0}", timeout);

            success = WindowsAutomation.Timing.WaitObject.WaitForCondition(wait_client, timeout, interval, out elapsed);

            Tracing.WriteLine("time elapsed: {0}", elapsed);
            Tracing.WriteLine("success: {0}", success);

            if (!success)
            {
                Tracing.WriteLine("Throwing timeout exception");
                string msg = string.Format("Time-out in WaitForDialogToAppear for Dialog {0}", t);

                throw new Errors.TimeOutError(msg);
            }

            return(wait_client.FoundDialog);
        }
Пример #2
0
		public int WaitForDialogToAppear(string t)
		{
			WaitForDialogToAppearObj wait_client = new WaitForDialogToAppearObj( this, t);
			int timeout = 5 * 1000 ; // 30 seconds
			int interval = 250; // .5 second
			int elapsed;
			bool success;

			
			Tracing.WriteLine( "max time to wait: {0}", timeout );

			success = WindowsAutomation.Timing.WaitObject.WaitForCondition( wait_client, timeout, interval, out elapsed );

			Tracing.WriteLine( "time elapsed: {0}", elapsed );
			Tracing.WriteLine( "success: {0}", success);

			if (!success)
			{
				Tracing.WriteLine( "Throwing timeout exception");
				string msg = string.Format( "Time-out in WaitForDialogToAppear for Dialog {0}", t );

				throw new Errors.TimeOutError( msg );
			}

			return wait_client.FoundDialog;
		}