Example #1
0
        public UIThreadInvoker()
        {
            _mainThreadId = Thread.CurrentThread.ManagedThreadId;

            var type    = DynamicInvoker.GetType("System.Windows.Forms", "Control");
            var control = Activator.CreateInstance(type);

            DynamicInvoker.InvokeMethod(control, "CreateControl");
            invokeMethod      = new MethodInvoker(control, "Invoke", new Type[] { typeof(Delegate) });
            beginInvokeMethod = new MethodInvoker(control, "BeginInvoke", new Type[] { typeof(Delegate) });
        }