예제 #1
0
        private async Task LoadStats()
        {
            string stats = null;

            if (!File.Exists(PATH_STATS))
            {
                var client = new OfficialTradeWebClient();
                stats = await client.FetchStatsAsync();

                if (stats == null)
                {
                    return;
                }

                await CreateStatsFileAsync(stats);
            }

            StatRepository.LoadStats(stats);
        }
예제 #2
0
        private async Task <IList <string> > GetLeagues()
        {
            IList <string> leagues = null;

            if (!File.Exists(PATH_LEAGUES))
            {
                var client = new OfficialTradeWebClient();
                leagues = await client.FetchLeaguesAsync();

                if (leagues != null)
                {
                    SaveLeaguesToFile(leagues);
                }
            }
            else
            {
                leagues = LoadLeaguesFromFile();
            }

            return(leagues);
        }