Skip to content

Commit

Permalink
fix anchor for tabcontrol & cancel not working
Browse files Browse the repository at this point in the history
  • Loading branch information
siblount committed Jan 12, 2024
1 parent 16ef656 commit 5b11dcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DAZ_Installer.TestingSuiteWindows/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/DAZ_Installer.TestingSuiteWindows/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private record class ProcessSession(DPProcessor Processor, DPArchive Archive, DP
private Task? lastTask;
private DPArchive? lastRootArchive;
ProcessSession? lastSession = null;
DPProcessor? currentProcessor = null;
CancellationTokenSource tokenSource = new();
public MainForm()
{
Expand Down Expand Up @@ -584,7 +585,7 @@ private void processTask()
Log.Information("Beginning to process archive.");
Log.Information("Archive File: {lastRootArchive}", archiveTxtBox.Text);
Log.Information("Settings to use: \n{@Settings}", JsonSerializer.Serialize(settings, new JsonSerializerOptions { WriteIndented = true }));
var processor = new DPProcessor();
var processor = currentProcessor = new DPProcessor();
try
{
processor.ArchiveEnter += (_, a) => arcs.Add(a.Archive);
Expand All @@ -600,6 +601,7 @@ private void processTask()
}
Log.Information("Finished processing archive.");
BeginInvoke(treeView1.Nodes.Clear);
currentProcessor = null;
if (arcs.Count == 0) return;
lastRootArchive = arcs[0];
lastSession = new(processor, lastRootArchive, this.settings, records);
Expand Down Expand Up @@ -671,6 +673,7 @@ private void MainForm_DragDrop(object sender, DragEventArgs e)

private void cancelBtn_Click(object sender, EventArgs e)
{
currentProcessor?.CancelProcessing();
lastSession?.Processor.CancelProcessing();
tokenSource.Cancel();
tokenSource = new();
Expand Down

0 comments on commit 5b11dcb

Please sign in to comment.