Heather V.
Heather V.

Reputation: 160

Notification after directory delete is done

When I use Directory.Delete, the delete completes after I update my controls tied to the folder structure.

 Directory.Delete(System.IO.Path.Combine(StorageSchemaPath, selectedSKU), true);

I have considering starting a timer to check when delete completes or timeout.

Are there any event notifications I can tie into instead?

Upvotes: 1

Views: 52

Answers (1)

AlexB
AlexB

Reputation: 91

You could attach a System.IO.FileSystemWatcher to the directory above and use the OnDeleted event.

See MSDN: https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.ondeleted(v=vs.110).aspx

Upvotes: 1

Related Questions