Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created September 24, 2012 01:33
Show Gist options
  • Save aaronpowell/3773739 to your computer and use it in GitHub Desktop.
Save aaronpowell/3773739 to your computer and use it in GitHub Desktop.
Extension methods for WinRT StorageFolder
public static class StorageFolderExtensions
{
public static async Task<bool> FileExistsAsync(this StorageFolder folder, string fileName)
{
try
{
await folder.GetFileAsync(fileName);
return true;
}
catch (FileNotFoundException)
{
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment