public static async Task GetLocationData()
        {
            Console.WriteLine("");
            Console.WriteLine("Loading location details from weather.gov ...");
            await APICallsController.GetWeatherLocationData();

            Console.WriteLine("");
            Console.WriteLine("Loading alert data from weather.gov ...");
            await APICallsController.GetAlertData();

            Console.WriteLine("");
            Console.WriteLine("Loading observation station identifier from weather.gov ...");
            await APICallsController.GetCurrentObservationStations();

            Console.WriteLine("");
            Console.WriteLine("Loading current and historical observation data from weather.gov ...");
            await APICallsController.GetCurrentObservationData();

            Console.WriteLine("");
            Console.WriteLine("Loading aggregate weather forecast data from weather.gov ...");
            await APICallsController.GetSevenDayForecast();

            Console.WriteLine("");
            Console.WriteLine("Loading granular forecast data from weather.gov ...");
            await APICallsController.GetSevenDayForecastHourly();

            await MainWelcomeView.Welcome();
        }
Пример #2
0
        public static async Task ReturnToWelcome()
        {
            Console.WriteLine("");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Press any key to return to the menu or Esc to exit.");
            Console.ForegroundColor = ConsoleColor.Gray;

            ConsoleKey menuChoice = Console.ReadKey(true).Key;

            switch (menuChoice)
            {
            case ConsoleKey.Escape: Environment.Exit(0); break;

            default: await MainWelcomeView.Welcome(); break;
            }
        }
Пример #3
0
        public static async Task Menu()
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("  1. Seven Day Forecast");
            Console.WriteLine("  2. Seven Day Forecast (Hourly)");
            Console.WriteLine("  3. Seven Day History (Hourly)");
            Console.WriteLine("  4. Change Location (Zip Code)");
            Console.WriteLine("  5. Toggle Metric/Imperial");
            Console.WriteLine("");
            Console.WriteLine("  Esc. to Exit");
            Console.ForegroundColor = ConsoleColor.Gray;

            ConsoleKey menuChoice = Console.ReadKey(true).Key;

            switch (menuChoice)
            {
            case ConsoleKey.D1: await SevenDayForecastView.SevenDayForecast(); break;

            case ConsoleKey.NumPad1: await SevenDayForecastView.SevenDayForecast(); break;

            case ConsoleKey.D2: await SevenDayForecastHourlyView.SevenDayForecastHourly(); break;

            case ConsoleKey.NumPad2: await SevenDayForecastHourlyView.SevenDayForecastHourly(); break;


            case ConsoleKey.D3: await SevenDayHistoryHourlyView.SevenDayHistoryHourly(); break;

            case ConsoleKey.NumPad3: await SevenDayHistoryHourlyView.SevenDayHistoryHourly(); break;

            case ConsoleKey.D4: await APICallsView.UpdateZipView(); break;

            case ConsoleKey.NumPad4: await APICallsView.UpdateZipView(); break;


            case ConsoleKey.D5: MiscController.FlipIsImperial(); await MainWelcomeView.Welcome(); break;

            case ConsoleKey.NumPad5: MiscController.FlipIsImperial(); await MainWelcomeView.Welcome(); break;

            case ConsoleKey.Escape: Environment.Exit(0); break;

            default: await MainWelcomeView.Welcome(); break;
            }
        }