Esempio n. 1
0
        private void DownloadMatchesArchiveAll()
        {
            List <HTEntities.MatchesArchive.Match> matchList = new List <HM.Entities.Hattrick.MatchesArchive.Match>();

            DateTime[,] monthDates = GenericFunctions.GetMonthDates(currentUser.activationDateField, DateTime.Now);

            // Replace first and last dates in the array with known start and end dates
            monthDates[0, 0] = currentUser.activationDateField;
            monthDates[monthDates.GetLength(0) - 1, 1] = DateTime.Now;

            for (int i = 0; i < monthDates.GetLength(0); i++)
            {
                DateTime startDate = monthDates[i, 0];
                DateTime endDate   = monthDates[i, 1];
                List <HM.Entities.Hattrick.MatchesArchive.Match> matches = DownloadMatchesArchive(startDate, endDate, false);
                matchList.AddRange(matches);
            }

            foreach (HTEntities.MatchesArchive.Match match in matchList)
            {
                string path     = System.IO.Path.Combine(currentUser.dataFolderField, FolderNames.MatchDetails);
                string fileName = String.Format(FileNames.MatchDetails, match.matchIdField.ToString());

                DownloadMatchDetails(match.matchIdField.ToString());
                DownloadMatchLineup(match.matchIdField.ToString(), match.homeTeamField.homeTeamIdField.ToString());
                DownloadMatchLineup(match.matchIdField.ToString(), match.awayTeamField.awayTeamIdField.ToString());
            }
        }