Ejemplo n.º 1
0
        public void ChooseReblaseGame(object param)
        {
            string gameId = FilterText;

            using (var client = new WebClient())
            {
                try
                {
                    string json = client.DownloadString($"https://api.sibr.dev/chronicler/v1/games/updates?game={gameId}&started=true&count=500");

                    var opts = new JsonSerializerOptions()
                    {
                        PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNameCaseInsensitive = true
                    };

                    var result = JsonSerializer.Deserialize <ChroniclerPage>(json, opts);

                    GameUpdates.Clear();
                    foreach (var cg in result.Data)
                    {
                        cg.Data.timestamp      = cg.Timestamp;
                        cg.Data.chroniclerHash = cg.Hash;
                        AddGame(cg.Data);
                    }
                }
                catch (Exception ex)
                {
                    Debugger.Break();
                }
            }
        }
Ejemplo n.º 2
0
        private async Task LoadUpdates(string updatesFile)
        {
            GameUpdates.Clear();

            LoadSaveEnabled      = false;
            UpdatesDisabled      = true;
            Mouse.OverrideCursor = Cursors.Wait;
            await AsyncLoadUpdates(updatesFile);

            Mouse.OverrideCursor = null;
            UpdatesDisabled      = false;
            LoadSaveEnabled      = true;

            m_convertCommand.RaiseCanExecuteChanged();
            OnPropertyChanged(nameof(FilteredUpdates));
        }
Ejemplo n.º 3
0
 internal void ClearUpdates()
 {
     GameUpdates.Clear();
     m_convertCommand.RaiseCanExecuteChanged();
 }