-
-
Save jhaynie/8247195 to your computer and use it in GitHub Desktop.
This file contains hidden or 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"); | |
}); | |
// this will only happen after Testing Sync Ops output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment