Пример #1
0
        public static IEnumerable <int> GetGames(string comunityId)
        {
            if (_instance == null || _instance._communityId != comunityId)
            {
                _instance = new AllOwnedGames(comunityId);
            }

            return(_instance._games);
        }
Пример #2
0
 public static IEnumerable<int> GetGames(string comunityId)
 {
     if (_instance == null || _instance._communityId!=comunityId)
     {
         _instance = new AllOwnedGames(comunityId);
     }
     
     return _instance._games;
 }
Пример #3
0
        public async Task Refresh()
        {
            GameDatas.SuspendCollectionChanged = true;
            var games = Task.Run <IEnumerable <GameData> >(() =>
            {
                return(AllOwnedGames.GetGames(UserData.SteamCommunityId)
                       .Select(o => new GameData(o))
                       .OrderBy(o => o.Installed ? 0 : 1)
                       .ThenBy(o => o.Name)
                       .ToList());
            });

            GameDatas.Clear();

            foreach (var game in (await games))
            {
                GameDatas.Add(game);
                game.SaveToCache();
            }
            GameDatas.SuspendCollectionChanged = false;
            GameDatas.RefreshBinding();
        }