Пример #1
0
        public void RefreshData()
        {
            Data.Enums.ReportType type = Data.Enums.ReportType.Text;
            if (csvCheckbutton.Checked)
            {
                type = Data.Enums.ReportType.CSV;
            }

            switch (currentReport)
            {
            case Report.Schedule:
                Task.Run(() => ReportHelpers.GetNextWeekScheduleReport(type, new TvmazeApi())).ContinueWith((task) => UpdateReport(task.Result));
                break;

            case Report.TopTen:
                UpdateReport(ReportHelpers.TopTenShowsReport(type));
                break;

            case Report.TopNetworks:
                UpdateReport(ReportHelpers.TopNetworksReport(type));
                break;

            case Report.ShowOverView:
                UpdateReport(ReportHelpers.ShowReport(type));
                break;

            case Report.Recommendations:
                UpdateReport(ReportHelpers.RecommendedShowsReport(selectedGenres.ToArray(), type));
                break;

            default:
                throw new NotSupportedException();
            }
        }