private static void ConsoleCommand() { bool inMenu = true; do { if (KeyAvailable) { switch (ReadKey(true).Key) { case ConsoleKey.Escape: inMenu = false; break; case ConsoleKey.W: LoadWindow(); return; case ConsoleKey.R: portControl.AddBoat(HarborHelper.GetRandomBoat().boat); PortMenu(); break; case ConsoleKey.D: portControl.IncrementTime(); PortMenu(); break; case ConsoleKey.S: portControl.SavePortData(); break; case ConsoleKey.L: portControl.LoadPortData(); PortMenu(); break; case ConsoleKey.C: portControl.ResetPort(); PortMenu(); break; } } } while (inMenu); }
private void ResetHarborButton_OnClick(object sender, RoutedEventArgs e) { portControl.ResetPort(); MessageBox.Show("The harbor was reset.", "Reset", MessageBoxButton.OK, MessageBoxImage.Information); }