public void TestMessageLoop() { /* GIVEN */ var autoResetEvent = new AutoResetEvent(false); var messageLoop = new MessageLoop(); /* WHEN */ var cancelThread = new Thread(() => { while (!messageLoop.IsRunning) { /* * We need to wait until it actually started. * However this will stop if the autoResetEvent is not fulfilled in time. */ } autoResetEvent.Set(); messageLoop.Stop(); }); cancelThread.Start(); messageLoop.Start(); /* THEN */ Assert.IsTrue(autoResetEvent.WaitOne(waitTimeInMilliseconds)); }
public bool Untap() { _messageLoop.Stop(); Uninstall(); return(!IsInstalled); }
public void Stop() { MessageLoop.Stop(); }