You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/apps/develop/files/determine-availability-microsoft-onedrive-files.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ The following steps illustrate how to determine if a file is currently available
52
52
53
53
The following generic method illustrates how to enumerate any folder and return the collection of [StorageFile](/uwp/api/Windows.Storage.StorageFile) objects for that folder. The calling method then iterates over the returned collection referencing the [StorageFile.IsAvailable](/uwp/api/windows.storage.storagefile.isavailable) property for each file.
54
54
55
-
```cs
55
+
```csharp
56
56
/// <summary>
57
57
/// Generic function that retrieves all files from the specified folder.
To get the folder in a library where new files are saved by default, get the value of the [StorageLibrary.SaveFolder](/uwp/api/windows.storage.storagelibrary.savefolder) property.
To add a folder to a library, you call the [StorageLibrary.RequestAddFolderAsync](/uwp/api/windows.storage.storagelibrary.requestaddfolderasync). Taking the Pictures Library as an example, calling this method causes a folder picker to be shown to the user with an **Add this folder to Pictures** button. If the user picks a folder then the folder remains in its original location on disk and it becomes an item in the [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) property (and in the built-in Photos app), but the folder does not appear as a child of the Pictures folder in File Explorer.
@@ -83,7 +83,7 @@ When you call [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage
83
83
The following example assumes that the user has selected the folder to remove from a [ListView](/uwp/api/Windows.UI.Xaml.Controls.ListView) control named lvPictureFolders.
@@ -93,7 +93,7 @@ bool result = await myPictures.RequestRemoveFolderAsync(folder);
93
93
To get notified about changes to the list of folders in a library, register a handler for the [StorageLibrary.DefinitionChanged](/uwp/api/windows.storage.storagelibrary.definitionchanged) event of the library.
@@ -125,7 +125,7 @@ Users or apps may also store media files outside the media library folders on th
125
125
126
126
To get a collection of files, specify the library and the type of files that you want.
127
127
128
-
```cs
128
+
```csharp
129
129
usingWindows.Storage;
130
130
usingWindows.Storage.Search;
131
131
@@ -171,7 +171,7 @@ The Camera Roll and the Saved Pictures folder do not support the deep queries.
171
171
172
172
If you want to let the user open a photo again later in the app that captured it, you can save the CreatorAppId with the photo's metadata by using code similar to the following example. In this example, testPhoto is a [StorageFile](/uwp/api/Windows.Storage.StorageFile).
@@ -186,7 +186,7 @@ When you access a media library by using a known folder such as KnownFolders.Pic
186
186
187
187
For example, when you run the following code, the file is not added to the media library. In the line of code, `using (var destinationStream = (await destinationFile.OpenAsync(FileAccessMode.ReadWrite)).GetOutputStreamAt(0))`, both the OpenAsync method and the GetOutputStreamAt method open a stream. However only the stream opened by the GetOutputStreamAt method is disposed as a result of the using statement. The other stream remains open and prevents saving the file.
@@ -201,7 +201,7 @@ using (var sourceStream = (await sourceFile.OpenReadAsync()).GetInputStreamAt(0)
201
201
202
202
To use stream methods successfully to add a file to the media library, make sure to close all the streams that your code opens, as shown in the following example.
Copy file name to clipboardExpand all lines: hub/apps/develop/files/track-recently-used-files-folders.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Your app's MRU is represented by the [StorageItemMostRecentlyUsedList](/uwp/api/
39
39
40
40
- The files that your user picks are often files that they return to repeatedly. So consider adding picked files to your app's MRU as soon as they are picked. Here's how.
0 commit comments