private void MergeDirectory() { OpenFileDialog dlg = new OpenFileDialog(); dlg.AddExtension = true; dlg.Title = "Merge Folder"; if (dlg.ShowDialog() == true) { var path = GetSelectedFolderPath(); if (path != null && !_bundle.DirectoryExists(path)) { _bundle.CreateDirectory(path); } var bundleFiles = new List <string>(_bundle.GetFiles()); var newBundle = new FileBundleEx(_bundle.FileName.Replace(".jbd", ".tmp.jbd"), 719); // TODO: numBuckets = prime_ceil(bundleFiles / 16) var folder = Path.GetDirectoryName(dlg.FileNames[0]); var files = Directory.GetFiles(folder); Progress.Reset(files.Length + bundleFiles.Count); Progress.Label = "Merging"; Progress.IsEnabled = true; _backgroundWorkerService.RunAsync(() => Merge(newBundle, _bundle, bundleFiles, files)); } }
private void Search() { Progress.Label = "Fetching Game " + GameId; Progress.IsEnabled = true; _backgroundWorkerService.RunAsync(() => { LoadGame(true, 100); }); }
public void Start() { if (_listener.IsListening) { return; } _listener.Start(); _backgroundWorkerService.RunAsync(Listen); }
public OpenTicketsViewModel(IFileSystemService fileSystemService, IHttpRequestService httpRequestService, IBackgroundWorkerService backgroundWorkerService) { _fileSystemService = fileSystemService; _httpRequestService = httpRequestService; _backgroundWorkerService = backgroundWorkerService; DialogTitle = "Open Tickets"; CanClose = true; OpenGameCommand = new DelegateCommand <GameTickets>(OpenGame); OpenGameTicketsCommand = new DelegateCommand <GameTickets>(OpenGameTickets); OpenAchievementCommand = new DelegateCommand <AchievementTickets>(OpenAchievement); Progress = new ProgressFieldViewModel { Label = String.Empty }; backgroundWorkerService.RunAsync(LoadTickets); }
public GameDataSnapshotViewModel(ProgressFieldViewModel progress, IBackgroundWorkerService backgroundWorkerService, ISettings settings) { _progress = progress; _backgroundWorkerService = backgroundWorkerService; _settings = settings; if (String.IsNullOrEmpty(settings.DoRequestToken)) { RefreshCommand = DisabledCommand.Instance; } else { RefreshCommand = new DelegateCommand(DoRefresh); } _gamesWithAchievements = new List <int>(); _gamesWithLeaderboards = new List <int>(); _gamesWithRichPresence = new List <int>(); if (_progress != null) { _backgroundWorkerService.RunAsync(LoadFromDisk); } }
private void DoRefresh() { _backgroundWorkerService.RunAsync(() => RefreshFromServer()); }
private void Search() { _backgroundWorkerService.RunAsync(DoSearch); }