I am using FileSystemWatcher to watch on a directory. On delete events I need to take different actions on files and folders. But I didn't find a way as the file/folder was already deleted.
One way can be to check if the file/folder path had any extension to it. but that's not a reliable way.
In Short I want to implement WasFile() method here ->
private static void OnDelete(object source, RenamedEventArgs e)
{
if(WasFile(e.FullPath))
{
Console.WriteLine("Deleted event {0} was a File", e.FullPath);
}
//else a folder
}