public ClientRunner() { if (instance != null) { throw new Exception("Clientrunner is already created!"); } instance = this; }
public static void runCicero(RunLog runLog) { try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); // Detect if Windows 7 or Vista is being used. OperatingSystem osInfo = System.Environment.OSVersion; if (osInfo.Version.Major == 6) { WordGenerator.GlobalInfo.usingWindows7 = true; } try { Application.SetCompatibleTextRenderingDefault(false); } catch (InvalidOperationException) { } MainClientForm mainForm; if (runLog == null) { mainForm = new MainClientForm(); } else { mainForm = new MainClientForm(runLog); } ClientRunner runner = new ClientRunner(); runner.messageLog += new EventHandler <MessageEvent>(mainForm.addMessageLogText); Storage.registerMessageLogHandler(mainForm.handleMessageEvent); Application.Run(mainForm); } catch (Exception e) { display_unhandled_exception(e); } }
public static void runCicero(RunLog runLog) { try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); // Detect if Windows 7 or Vista is being used. OperatingSystem osInfo = System.Environment.OSVersion; if (osInfo.Version.Major == 6) { WordGenerator.GlobalInfo.usingWindows7 = true; } try { Application.SetCompatibleTextRenderingDefault(false); } catch (InvalidOperationException) { } MainClientForm mainForm; if (runLog == null) { mainForm = new MainClientForm(); } else { mainForm = new MainClientForm(runLog); } ClientRunner runner = new ClientRunner(); runner.messageLog += new EventHandler<MessageEvent>(mainForm.addMessageLogText); Storage.registerMessageLogHandler(mainForm.handleMessageEvent); Application.Run(mainForm); } catch (Exception e) { display_unhandled_exception(e); } }