private void WaitUntilTrue(Func<bool> item,int waitDuration) { while(!item()) Thread.Sleep(waitDuration); }