示例#1
0
        public void DispatcherOnSameThread()
        {
            var d1 = new MyDispatcherObject();
            var d2 = new MyDispatcherObject();

            Assert.IsNotNull(d1);
            Assert.IsNotNull(d2);
            Assert.AreSame(d1.Dispatcher, d2.Dispatcher);
        }
示例#2
0
        private static DispatcherObject CreateDispatcherObjectOnThread()
        {
            DispatcherObject dispatcherObject = null;
            var thread = new Thread(() => dispatcherObject = new MyDispatcherObject());

            thread.Start();
            thread.Join();

            return(dispatcherObject);
        }
示例#3
0
        public void VerifyAccessOnSameThread()
        {
            DispatcherObject d = new MyDispatcherObject();

            d.VerifyAccess();
        }
示例#4
0
        public void CheckAccessOnSameThread()
        {
            DispatcherObject d = new MyDispatcherObject();

            Assert.IsTrue(d.CheckAccess());
        }