Created
January 3, 2014 21:39
-
-
Save mtnlife999/8247140 to your computer and use it in GitHub Desktop.
Async
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
auto _Folder = Windows::Storage::ApplicationData::Current->LocalFolder; | |
auto _Option = Windows::Storage::CreationCollisionOption::ReplaceExisting; | |
// create file async | |
_Folder->CreateFileAsync("MyFileName", _Option); | |
// create file sync by wrapping in task - then pattern | |
IAsyncOperation<StorageFile^>^ fileOp = _Folder->CreateFileAsync("MyFileName2", _Option); | |
auto deviceEnumTask = create_task(fileOp); | |
deviceEnumTask.then([](StorageFile^ myFile) | |
{ | |
// file is created | |
OutputDebugStringA("Testing Sync Ops"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment