示例#1
0
		public override void Execute(Speed speed)
		{
			//no delay for speed on showing a form.
			try
			{
				Type formType = Type.GetType(Control.Trim());
				if(formType == null)
				{
					foreach(Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
					{
						formType = assembly.GetType(Control.Trim());
						if(formType != null)
						{
							break;
						}
						formType = assembly.GetType(Control.Substring(0, Control.IndexOf(",")));
						if(formType != null)
						{
							break;
						}
					}
				}
				Form formInstance = (Form) Activator.CreateInstance(formType);
				formInstance.Show();
			}
			catch
			{
				throw new FormsTestAssertionException("Form display failed. Be sure to load the form assembly first.");
			}
		}
示例#2
0
		public override void Execute(Speed speed)
		{
			SlowDownAndPaint(speed);

			ControlTester tester = GetTester();
			try
			{
				MethodInfo methodInfo =
						tester.GetType().GetMethod(Action,
												   BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
				methodInfo.Invoke(tester, new object[] {Args});
			}
			catch(Exception e)
			{
				throw new FormsTestAssertionException(
						string.Format("Line Number {0} : {1} : {2}", LineNumber, e.Message, e.StackTrace));
			}

			SlowDownAndPaint(speed);
		}
示例#3
0
文件: Command.cs 项目: bbriggs/wesay
		protected void SlowDownAndPaint(Speed speed)
		{
			if(speed.Value < 100 && !speed.StepMode)
			{
				PaintAllForms();
			}
			speed.Delay();
		}
示例#4
0
文件: Command.cs 项目: bbriggs/wesay
		public abstract void Execute(Speed speed);