Exemple #1
0
        public void DisposeDispatcherFirst()
        {
            ManualDispatcher dispatcher = new ManualDispatcher();
            IActionQueue     queue      = dispatcher.CreateQueue();

            dispatcher.Dispose();
            Assert.IsNull(queue.Dispatcher);

            ((IDisposable)queue).Dispose();
        }
Exemple #2
0
        public void DisposeQueueInsideAction()
        {
            ManualDispatcher dispatcher = new ManualDispatcher();
            IActionQueue     queue      = dispatcher.CreateQueue();

            queue.Enqueue(() => {});
            queue.Enqueue(() => { ((IDisposable)queue).Dispose(); });
            queue.Enqueue(() => {});

            dispatcher.ProcessQueues();
            dispatcher.Dispose();
        }
Exemple #3
0
        public void DisposeQueueFirst()
        {
            ManualDispatcher dispatcher = new ManualDispatcher();
            IActionQueue     queue      = dispatcher.CreateQueue();
            string           name       = queue.Name;

            ((IDisposable)queue).Dispose();
            Assert.IsNull(queue.Dispatcher);
            Assert.IsNull(dispatcher.GetQueueByName(name));

            dispatcher.Dispose();
        }