Skip to content

Commit

Permalink
how is it not clear that idk what im doing
Browse files Browse the repository at this point in the history
  • Loading branch information
bagusnl authored Dec 19, 2024
1 parent a3ca990 commit a65b937
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions CollapseLauncher/XAMLs/MainApp/Pages/FileCleanupPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,34 @@ await Task.Run(() =>
sI.Stop();
Logger.LogWriteLine($"[FileCleanupPage::InjectFileInfoSource] Finished batch #{b} with {batch.Count} items after {s.ElapsedMilliseconds} ms", LogType.Scheme);
b++;
sI = null;
}));

}
});
await Task.WhenAll(tasks);

await EnqueueOnDispatcherQueueAsync(() =>
{
var i = 0;
var sI = new Stopwatch();
sI.Start();
while (_localFileCollection.Count > 0)
if (_localFileCollection.Count > 0)
{
await EnqueueOnDispatcherQueueAsync(() =>
{
FileInfoSource.Add(_localFileCollection[0]);
_localFileCollection.RemoveAt(0);
i++;
}

sI.Stop();
Logger
.LogWriteLine($"[FileCleanupPage::InjectFileInfoSource] Finished last batch at #{b} after {i} items",
LogType.Scheme);
});

var i = 0;
var sI = new Stopwatch();
sI.Start();
while (_localFileCollection.Count > 0)
{
FileInfoSource.Add(_localFileCollection[0]);
_localFileCollection.RemoveAt(0);
i++;
}

sI.Stop();
Logger
.LogWriteLine($"[FileCleanupPage::InjectFileInfoSource] Finished last batch at #{b} after {i} items in {sI.ElapsedMilliseconds} ms",
LogType.Scheme);
});
}

while (_localFileCollection.Count != 0)
{
FileInfoSource.Add(_localFileCollection[0]);
Expand All @@ -131,7 +135,6 @@ await EnqueueOnDispatcherQueueAsync(() =>
DeleteSelectedFilesText.Text =
string.Format(Locale.Lang._FileCleanupPage.BottomButtonDeleteSelectedFiles, 0);
}

}

private void UpdateUIOnCollectionChange(object? sender, NotifyCollectionChangedEventArgs? args)
Expand Down

0 comments on commit a65b937

Please sign in to comment.