public ApplicationExitDispatcher()
        {
            var type = DynamicInvoker.GetType("System.Windows.Forms", "Application");

            if (type != null)
            {
                DynamicInvoker.AddEventHandler <EventHandler>(type, "ApplicationExit", Application_ApplicationExit);
            }
        }
Beispiel #2
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) });
        }
Beispiel #3
0
        public AppCrash()
        {
            var applicationType = DynamicInvoker.GetType("System.Windows.Forms", "Application");

            if (applicationType != null)
            {
                DynamicInvoker.AddEventHandler <ThreadExceptionEventHandler>(applicationType, "ThreadException", Application_ThreadException);
            }
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            ProductName   = DynamicInvoker.GetPropertyValue(applicationType, "ProductName") as string;
            DeveloperMail = "*****@*****.**";
            CrashDir      = "CrashLogs";
        }
Beispiel #4
0
        public static bool IsSupported()
        {
            var type = DynamicInvoker.GetType("System.Windows.Forms", "Control");

            return(type != null);
        }