Ejemplo n.º 1
0
        private void FetchTennisResults()
        {
            ProgressReporterProvider.Current.ReportProgress("Enter the date to fetch tennis results (dd/mm/yy)", ReporterImportance.High, ReporterAudience.Admin);

            var      dateString = Console.ReadLine();
            DateTime date;

            if (!DateTime.TryParse(dateString, out date))
            {
                Console.WriteLine("You f*****g moron!");
                return;
            }
            try
            {
                var fixtures = tennisService.FetchTennisResults(date);

                foreach (var fixture in fixtures)
                {
                    ProgressReporterProvider.Current.ReportProgress(
                        string.Format("Picked up {0} vs. {1} on {2}", fixture.PlayerAFirstName, fixture.PlayerBFirstName, date.ToShortDateString()),
                        ReporterImportance.Medium,
                        ReporterAudience.Admin);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }