Exemplo n.º 1
0
 public void Dispose()
 {
     if (StaThread.IsAlive)
     {
         DispatcherSynchronizationContext.Post(_ => Dispatcher.ExitAllFrames(), null);
         StaThread.Join();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Cleans up the scheduler by indicating that no more tasks will be queued.
 /// This method blocks until all threads successfully shutdown.
 /// </summary>
 public void Dispose()
 {
     if (StaThread.IsAlive)
     {
         Dispatcher.InvokeShutdown();
         StaThread.Join();
     }
 }