static void Main(string[] args) { PrintHerald(); // Cons up a system to run stuff on. DSystem system = new DSystem(); system.Reset(); // // Start the UI, this will not return from ShowDialog // until the window is closed. // DWindow mainWindow = new DWindow(system); system.AttachDisplay(mainWindow); DialogResult res = mainWindow.ShowDialog(); // // Main window is now closed: shut down the system. // Ensure the system is stopped. // system.StopExecution(); // // Commit disks on normal exit // system.Shutdown(res == DialogResult.OK); Console.WriteLine("Goodbye..."); }
static void Main(string[] args) { // // Check for command-line arguments. // if (args.Length > 0) { for (int i = 0; i < args.Length; i++) { switch (args[i++].ToLowerInvariant()) { case "-config": if (i < args.Length) { StartupOptions.ConfigurationFile = args[i]; } else { PrintUsage(); return; } break; case "-rompath": if (i < args.Length) { StartupOptions.RomPath = args[i]; } else { PrintUsage(); return; } break; default: PrintUsage(); return; } } } PrintHerald(); // Cons up a system to run stuff on. DSystem system = new DSystem(); system.Reset(); // // Start the UI, this will not return from ShowDialog // until the window is closed. // DWindow mainWindow = new DWindow(system); system.AttachDisplay(mainWindow); DialogResult res = mainWindow.ShowDialog(); // // Main window is now closed: shut down the system. // Ensure the system is stopped. // system.StopExecution(); // // Commit disks on normal exit // system.Shutdown(res == DialogResult.OK); Console.WriteLine("Goodbye..."); }