Skip to content

Commit

Permalink
Windows 10 Version 1809 - April 2019 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Apr 4, 2019
2 parents d0e9bc9 + 47bb54a commit dcb66df
Show file tree
Hide file tree
Showing 359 changed files with 2,439 additions and 3,416 deletions.
2 changes: 1 addition & 1 deletion Samples/360VideoPlayback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- cpp
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/3DPrinting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languages:
- csharp
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/3DPrintingFromUnity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languages:
- csharp
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/Accelerometer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/ActivitySensor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AdaptiveStreaming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languages:
- csharp
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AdvancedCasting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/Advertising/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- js
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AllJoyn/ConsumerExperiences/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- js
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AllJoyn/ProducerExperiences/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- js
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/Altimeter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AnimationLibrary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languages:
- js
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AnimationMetrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AppServices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/ApplicationData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/ApplicationResources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/Appointments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AssociationLaunching/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
4 changes: 2 additions & 2 deletions Samples/AssociationLaunching/cs/Scenario3_ReceiveFile.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)

private async void CreateTestFile()
{
StorageFolder folder = KnownFolders.PicturesLibrary;
StorageFolder folder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
await folder.CreateFileAsync("Test " + Extension + " file." + Extension, CreationCollisionOption.ReplaceExisting);
await Windows.System.Launcher.LaunchFolderAsync(folder);
}

private async void RemoveTestFile()
{
StorageFolder folder = KnownFolders.PicturesLibrary;
StorageFolder folder = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
try
{
StorageFile file = await folder.GetFileAsync("Test " + Extension + " file." + Extension);
Expand Down
4 changes: 2 additions & 2 deletions Samples/AssociationLaunching/vb/Scenario3_ReceiveFile.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ Namespace Global.SDKTemplate
End Sub

Private Async Sub CreateTestFile()
Dim folder As StorageFolder = KnownFolders.PicturesLibrary
Dim folder As StorageFolder = Await KnownFolders.GetFolderForUserAsync(Nothing, KnownFolderId.PicturesLibrary) ' "Nothing" means current user
Await folder.CreateFileAsync("Test " & Extension + " file." & Extension, CreationCollisionOption.ReplaceExisting)
Await Windows.System.Launcher.LaunchFolderAsync(folder)
End Sub

Private Async Sub RemoveTestFile()
Dim folder As StorageFolder = KnownFolders.PicturesLibrary
Dim folder As StorageFolder = Await KnownFolders.GetFolderForUserAsync(Nothing, KnownFolderId.PicturesLibrary) ' "Nothing" means current user
Try
Dim file As StorageFile = Await folder.GetFileAsync("Test " & Extension + " file." & Extension)
Await file.DeleteAsync()
Expand Down
2 changes: 1 addition & 1 deletion Samples/AudioCategory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/AudioCreation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ languages:
- csharp
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackButton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundActivation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundMediaPlayback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- js
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundSensors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundTask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
2 changes: 1 addition & 1 deletion Samples/BackgroundTransfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ languages:
- vb
products:
- windows
- uwp
- windows-uwp
---

<!---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,11 @@ void Scenario1_Download::StartDownload(BackgroundTransferPriority priority)
return;
}

create_task(KnownFolders::PicturesLibrary->CreateFileAsync(destination, CreationCollisionOption::GenerateUniqueName))
.then([this, source, priority] (StorageFile^ destinationFile)
create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
.then([destination](StorageFolder^ picturesLibrary)
{
return picturesLibrary->CreateFileAsync(destination, CreationCollisionOption::GenerateUniqueName);
}).then([this, source, priority] (StorageFile^ destinationFile)
{
BackgroundDownloader^ downloader = ref new BackgroundDownloader();
DownloadOperation^ download = downloader->CreateDownload(source, destinationFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ bool Scenario3_Notifications::TryCreateDownloadAsync(
}

String^ fileName = ((type == ScenarioType::Tile) ? L"Tile" : L"Toast") + "." + runId + "." + fileNameSuffix + ".txt";
resultTask = create_task(KnownFolders::PicturesLibrary->CreateFileAsync(fileName, CreationCollisionOption::GenerateUniqueName))
.then([this, source, downloader, downloadOperations] (StorageFile^ destinationFile)
resultTask = create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
.then([fileName](StorageFolder^ picturesLibrary)
{
return picturesLibrary->CreateFileAsync(fileName, CreationCollisionOption::GenerateUniqueName);
}).then([this, source, downloader, downloadOperations] (StorageFile^ destinationFile)
{
downloadOperations->Append(downloader->CreateDownload(source, destinationFile));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ void Scenario4_CompletionGroups::StartDownloadsButton_Click(Object^ sender, Rout
return;
}

task<StorageFile^> createFileTask = create_task(KnownFolders::PicturesLibrary->CreateFileAsync(
"picture.png",
CreationCollisionOption::GenerateUniqueName));
task<StorageFile^> createFileTask = create_task(KnownFolders::GetFolderForUserAsync(nullptr /* current user */, KnownFolderId::PicturesLibrary))
.then([](StorageFolder^ picturesLibrary)
{
return picturesLibrary->CreateFileAsync("picture.png", CreationCollisionOption::GenerateUniqueName);
});

task<void> postCreateFileTask = createFileTask.then([this, downloader, source](task<StorageFile^> createFileTask)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ private async void StartDownload(BackgroundTransferPriority priority)
StorageFile destinationFile;
try
{
destinationFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
destinationFile = await picturesLibrary.CreateFileAsync(
destination,
CreationCollisionOption.GenerateUniqueName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ private async Task<DownloadOperation> CreateDownload(BackgroundDownloader downlo
StorageFile destinationFile;
try
{
destinationFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
destinationFile = await picturesLibrary.CreateFileAsync(
fileName, CreationCollisionOption.GenerateUniqueName);
}
catch (FileNotFoundException ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private async void StartDownloadsButton_Click(object sender, RoutedEventArgs e)

private async Task<IStorageFile> CreateResultFileAsync(int id)
{
IStorageFile resultFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
StorageFolder picturesLibrary = await KnownFolders.GetFolderForUserAsync(null /* current user */, KnownFolderId.PicturesLibrary);
IStorageFile resultFile = await picturesLibrary.CreateFileAsync(
String.Format(CultureInfo.InvariantCulture, "picture{0}.png", id),
CreationCollisionOption.GenerateUniqueName);
return resultFile;
Expand Down
8 changes: 5 additions & 3 deletions Samples/BackgroundTransfer/js/js/scenario1_Download.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@

this.start = function (uri, fileName, priority) {
// Asynchronously create the destination file in the pictures folder.
Windows.Storage.KnownFolders.picturesLibrary.createFileAsync(
fileName, Windows.Storage.CreationCollisionOption.generateUniqueName)
.done(function (destinationFile) {
Windows.Storage.KnownFolders.getFolderForUserAsync(null /* current user */, Windows.Storage.KnownFolderId.picturesLibrary)
.then(function (picturesLibrary) {
return picturesLibrary.createFileAsync(
fileName, Windows.Storage.CreationCollisionOption.generateUniqueName);
}).done(function (destinationFile) {
var downloader = new BackgroundTransfer.BackgroundDownloader();

// Create a new download operation.
Expand Down
10 changes: 6 additions & 4 deletions Samples/BackgroundTransfer/js/js/scenario3_Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@

var fileName = type + "." + String(runId) + "." + fileNameSuffix + ".txt";

return Windows.Storage.KnownFolders.picturesLibrary.createFileAsync(
fileName,
Windows.Storage.CreationCollisionOption.generateUniqueName)
.then(function (destinationFile) {
return Windows.Storage.KnownFolders.getFolderForUserAsync(null /* current user */, Windows.Storage.KnownFolderId.picturesLibrary)
.then(function (picturesLibrary) {
return picturesLibrary.createFileAsync(
fileName,
Windows.Storage.CreationCollisionOption.generateUniqueName);
}).then(function (destinationFile) {
downloadOperations.push(downloader.createDownload(source, destinationFile));
}, function (err) {
displayException(err, fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@
var promiseArray = [];
for (var i = 0; i < 10; i++) {
var uri = new Windows.Foundation.Uri(baseUri, "?id=" + String(i));
promiseArray[i] = Windows.Storage.KnownFolders.picturesLibrary.createFileAsync(
"picture" + String(i) + ".png", Windows.Storage.CreationCollisionOption.generateUniqueName)
.then(function (destinationFile) {
promiseArray[i] = Windows.Storage.KnownFolders.getFolderForUserAsync(null /* current user */, Windows.Storage.KnownFolderId.picturesLibrary)
.then(function (picturesLibrary) {
return picturesLibrary.createFileAsync(
"picture" + String(i) + ".png", Windows.Storage.CreationCollisionOption.generateUniqueName);
}).then(function (destinationFile) {
var download = downloader.createDownload(uri, destinationFile);
download.startAsync().then(complete, complete, null);
}, error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ Namespace Global.BackgroundTransfer

Dim destinationFile As StorageFile
Try
destinationFile = Await KnownFolders.PicturesLibrary.CreateFileAsync(destination, CreationCollisionOption.GenerateUniqueName)
Dim picturesLibrary As StorageFolder = Await KnownFolders.GetFolderForUserAsync(Nothing, KnownFolderId.PicturesLibrary) ' Nothing = current user
destinationFile = Await picturesLibrary.CreateFileAsync(destination, CreationCollisionOption.GenerateUniqueName)
Catch ex As FileNotFoundException
rootPage.NotifyUser("Error while creating file: " & ex.Message, NotifyType.ErrorMessage)
Return
Expand Down
Loading

0 comments on commit dcb66df

Please sign in to comment.