Skip to content

Commit

Permalink
Revert event renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Sep 3, 2021
1 parent 03ce94d commit e579722
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Files/ViewModels/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ItemViewModel : ObservableObject, IDisposable
private readonly SemaphoreSlim enumFolderSemaphore;
private readonly ConcurrentQueue<(uint Action, string FileName)> operationQueue;
private readonly ConcurrentDictionary<string, bool> itemLoadQueue;
private readonly AsyncManualResetEvent operationEvent, loadPropsEvent;
private readonly AsyncManualResetEvent operationEvent, itemLoadEvent;
private IntPtr hWatchDir;
private IAsyncAction aWatcherAction;

Expand Down Expand Up @@ -351,7 +351,7 @@ public ItemViewModel(FolderSettingsViewModel folderSettingsViewModel)
loadPropsCTS = new CancellationTokenSource();
operationEvent = new AsyncManualResetEvent();
enumFolderSemaphore = new SemaphoreSlim(1, 1);
loadPropsEvent = new AsyncManualResetEvent();
itemLoadEvent = new AsyncManualResetEvent();
shouldDisplayFileExtensions = App.AppSettings.ShowFileExtensions;

AppServiceConnectionHelper.ConnectionChanged += AppServiceConnectionHelper_ConnectionChanged;
Expand Down Expand Up @@ -915,7 +915,7 @@ public async Task LoadExtendedItemProperties(ListedItem item, uint thumbnailSize
{
await Task.Run(async () =>
{
await loadPropsEvent.WaitAsync(cts.Token);
await itemLoadEvent.WaitAsync(cts.Token);

if (itemLoadQueue.TryGetValue(item.ItemPath, out var canceled) && canceled)
{
Expand Down Expand Up @@ -1130,7 +1130,7 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi
return;
}

loadPropsEvent.Reset();
itemLoadEvent.Reset();

try
{
Expand Down Expand Up @@ -1188,7 +1188,7 @@ private async void RapidAddItemsToCollectionAsync(string path, string previousDi
{
DirectoryInfoUpdated?.Invoke(this, EventArgs.Empty); // Make sure item count is updated
enumFolderSemaphore.Release();
loadPropsEvent.Set();
itemLoadEvent.Set();
}

postLoadCallback?.Invoke();
Expand Down

0 comments on commit e579722

Please sign in to comment.