コード例 #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);
        }