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