Example #1
0
 public void RunCommand(string command, DoneHandler done = null)
 {
     //AddText(command + "\r\n");
     this.runner.Run(command, () =>
     {
         done?.Invoke();
     });
 }
Example #2
0
        private static IEnumerator WaitWhileTrueCoroutine(Func <bool> condition, DoneHandler callback, float timeoutSeconds, bool reverseCondition = false)
        {
            while ((timeoutSeconds > 0) && (condition.Invoke() == !reverseCondition))
            {
                timeoutSeconds -= Time.deltaTime;
                yield return(null);
            }

            callback.Invoke(timeoutSeconds > 0);
        }
Example #3
0
 /// <summary>
 ///     Waits while condition is true
 ///     If timed out, callback will be invoked with false
 /// </summary>
 public static void WaitWhile(Func <bool> condiction, DoneHandler doneCallback, float timeoutSeconds)
 {
     CoroutineHelper.StartCoroutine(WaitWhileTrueCoroutine(condiction, doneCallback, timeoutSeconds));
 }
 public DoneHandlerTests()
 {
     _subject = new DoneHandler(_taskRepository.Object);
 }
Example #5
0
 public static void WaitUntil(Func <bool> condiction, DoneHandler doneCallback, float timeoutSeconds)
 {
     _instance.StartCoroutine(WaitWhileTrueCoroutine(condiction, doneCallback, timeoutSeconds, true));
 }
Example #6
0
	public static void Destroy ()
	{
		if (_md != null)
		{
			_md.Response -= new ResponseHandler(RespHandler);

			_md.Destroy ();
			_md = null;
			_doneHandler = null;
		}
	}
Example #7
0
	public static void ShowModeless(string msg, DoneHandler dh)
	{
		_doneHandler = dh;
		_md = new MessageDialog (null, DialogFlags.DestroyWithParent, MessageType.Other, ButtonsType.Ok, msg);
		_md.Response += new ResponseHandler(RespHandler);
		_md.ShowNow();
		//_md.Run();
	}
Example #8
0
 public void RunInProject(string command, DoneHandler done = null)
 {
     this.RunCommand("\"cd /d " + package.ProjectPath + " && " + command + "\"", done);
 }
Example #9
0
 public void RunTruffleCommand(string command, DoneHandler done = null)
 {
     this.RunCommand("\"cd /d " + package.ProjectPath + " && .\\node_modules\\.bin\\truffle.cmd " + command + " --no-colors", done);
 }