示例#1
0
        private async void InitializeKnownGames()
        {
            PossibleGameNames.Clear();
            if (!SelectedApiClient.HasTopStreamGameFilterSupport)
            {
                return;
            }

            try
            {
                var games = await SelectedApiClient.GetKnownGameNames(null);

                PossibleGameNames.AddRange(games.Select(x => x.GameName));
            }
            catch
            {
            }
        }
示例#2
0
        private async void UpdatePossibleGameNames()
        {
            var game = GameName; // store local variable in case GameName changes while this is running

            if (!SelectedApiClient.HasTopStreamGameFilterSupport || string.IsNullOrWhiteSpace(game))
            {
                return;
            }

            try
            {
                var games = await SelectedApiClient.GetKnownGameNames(game);

                var oldItems = PossibleGameNames.ToList();
                PossibleGameNames.AddRange(games.Select(x => x.GameName));
                PossibleGameNames.RemoveRange(oldItems);
                ExpandPossibleGames = true;
            }
            catch
            {
                // make sure we dont crash just updating auto-completion options
            }
        }