private void ExtractAsync(GameFile entry, string destination) { CancellationTokenSource tokenSource = new CancellationTokenSource(); ProgressBarWindow window = new ProgressBarWindow(); window.StartDialogWithAction(() => entry.ExtractAsync(destination, tokenSource.Token, (progress, description) => { window.InvokeOnThread(new Action(() => { window.SetProgress(progress); window.SetOperationText(description); if (progress == 100) { window.Close(); } })); }), tokenSource); }