示例#1
0
        public void  WaitForDialogToDisappear(int dialog)
        {
            WaitForDialogToCloseObj wait_client = new WaitForDialogToCloseObj(this, dialog);
            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 WaitForDialogToDisappear for Dialog {0}", dialog);
                throw new Errors.TimeOutError(msg);
            }
        }
示例#2
0
		public void  WaitForDialogToDisappear(int dialog)
		{
			WaitForDialogToCloseObj wait_client = new WaitForDialogToCloseObj( this, dialog);
			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 WaitForDialogToDisappear for Dialog {0}", dialog);
				throw new Errors.TimeOutError( msg );
			}
		}