Created
September 24, 2012 01:33
-
-
Save aaronpowell/3773739 to your computer and use it in GitHub Desktop.
Extension methods for WinRT StorageFolder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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