private void ReadXml()
        {
            var content = ReadContent();

            if (String.IsNullOrWhiteSpace(content))
            {
                return;
            }

            try
            {
                var xml = XDocument.Parse(content).Root;
                if (xml != null)
                {
                    SessionId          = (string)xml.Element("SessionId");
                    SteamLogin         = (string)xml.Element("SteamLogin");
                    SteamLoginSecure   = (string)xml.Element("SteamLoginSecure");
                    SteamProfileUrl    = (string)xml.Element("SteamProfileUrl");
                    SteamParental      = (string)xml.Element("SteamParental");
                    SteamRememberLogin = (string)xml.Element("SteamRememberLogin");
                    MachineAuth        = (string)xml.Element("MachineAuth");

                    IgnoreClient = ReadBool(xml.Element("IgnoreClient"));

                    SteamAvatarUrl      = (string)xml.Element("SteamAvatarUrl");
                    SteamBackgroundUrl  = (string)xml.Element("SteamBackgroundUrl");
                    SteamUserName       = (string)xml.Element("SteamUserName");
                    SteamLevel          = (string)xml.Element("SteamLevel");
                    CustomBackgroundUrl = (string)xml.Element("CustomBackgroundUrl");
                    SteamBadgeTitle     = (string)xml.Element("SteamBadgeTitle");
                    SteamBadgeUrl       = (string)xml.Element("SteamBadgeUrl");

                    BadgeFilter               = (string)xml.Element("BadgeFilter");
                    ShowcaseFilter            = (string)xml.Element("ShowcaseFilter");
                    IdleMode                  = ReadInt(xml.Element("IdleMode"));
                    MaxIdleProcessCount       = ReadByte(xml.Element("MaxIdleProcessCount"));
                    PeriodicSwitchRepeatCount = ReadByte(xml.Element("PeriodicSwitchRepeatCount"));
                    TrialPeriod               = ReadDouble(xml.Element("TrialPeriod"));
                    SwitchMinutes             = ReadByte(xml.Element("SwitchMinutes"));
                    SwitchSeconds             = ReadByte(xml.Element("SwitchSeconds"));

                    AllowShowcaseSync = ReadBool(xml.Element("AllowShowcaseSync"));
                    ShowInTaskbar     = ReadBool(xml.Element("ShowInTaskbar"), true);

                    IdleQueue.AddRange(GetStringList(xml.Element("IdleQueue")));
                    Blacklist.AddRange(GetStringList(xml.Element("Blacklist")));
                    ShowcaseBookmarks.AddRange(GetStringList(xml.Element("ShowcaseBookmarks")));
                    Games.AddRange(GetStringList(xml.Element("Games")));
                    AppBrushes.AddRange(GetStringList(xml.Element("AppBrushes")));
                }

                Logger.Info("Settings storage initialized");
            }
            catch (Exception ex)
            {
                Logger.Exception(ex, "Settings storage");
            }
        }
Exemple #2
0
        private void FetchGames()
        {
            using (var ctx = new MyDbContext())
            {
                Games.AddRange(ctx.Games.Where(g => g.UserId == User.UserId).ToList());
            }

            GameLogGrid.Items.Refresh();
        }
Exemple #3
0
 private void InitCommands()
 {
     Search = new RelayCommand(x =>
     {
         Games.Clear();
         Games.AddRange(gs.GetAll().Where(y => y.GameName.ToLower().Contains(SearchText.ToLower())));
         SearchResult = $"Результатов по вашему запросу {Games.Count}.";
     });
 }
Exemple #4
0
        /// <summary>
        /// Loads list of installed games.
        /// </summary>
        private void LoadGames()
        {
            Games.Clear();

            foreach (var lib in Libraries)
            {
                Games.AddRange(lib.GetGames().ToList());
            }
        }
Exemple #5
0
        public void GetGames()
        {
            Games.Clear();
            var games = myGameDbManager.GetGamesForTeam(MainViewModel.Instance.Team.Id);

            if (games == null)
            {
                return;
            }
            Games.AddRange(games);
            OnPropertyChanged(nameof(Games));
        }
        //public override async Task Migrate() {}

        public override async Task LoadAll(bool skip = false)
        {
            using (this.Bench()) {
                var gamesToAdd = await
                                 Task.WhenAll(
                    GetSupportedGameIds()
                    .Where(x => !Games.Select(g => g.Id).Contains(x))
                    .Select(x => RetrieveGame(x, skip))).ConfigureAwait(false);

                Games.AddRange(gamesToAdd.Where(x => x != null));
            }
        }
 /// <summary>
 ///		Carga los datos de un archivo
 /// </summary>
 public void Load(string fileName)
 {
     Games.Clear();
     Games.AddRange(new Parser.GameParser().Load(fileName));
 }
 public GameFinderResult(IEnumerable <Game> games)
 {
     Games.AddRange(games);
 }