/// <summary> /// Save a Replay File result /// </summary> /// <param name="fileResult"></param> public ReplayPreview AddReplay(FileResult file) { var previewModel = CreateReplayPreview(file); App.Current.Dispatcher.Invoke((Action) delegate { PreviewReplays.Add(previewModel); }); FileResults.Add(file.FileInfo.Path, file); return(previewModel); }
/// <summary> /// Get replays from database and load to display /// </summary> public void LoadReplays() { _log.Information("Loading replays from database..."); var databaseResults = _fileManager.GetReplays(SortParameters, SettingsManager.Settings.ItemsPerPage, PreviewReplays.Count); _log.Information($"Retrieved {databaseResults.Count} replays"); foreach (var file in databaseResults) { var previewModel = CreateReplayPreview(file); App.Current.Dispatcher.Invoke((Action) delegate { PreviewReplays.Add(previewModel); }); FileResults.Add(file.FileInfo.Path, file); } }