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
<summary>Contains extension methods for the <seecref="T:Windows.Storage.IStorageFile"/> and <seecref="T:Windows.Storage.IStorageFolder"/> interfaces in the Windows Runtime when developing Windows Store apps.</summary>
24
+
<remarks>
25
+
<formattype="text/markdown"><![CDATA[
26
+
27
+
## Remarks
28
+
29
+
These extension methods are available only when you develop Windows Store apps. The methods provide convenient ways of opening files for reading or writing in Windows Store apps. You do not create an instance of the `WindowsRuntimeStorageExtensions` class; instead, you use these methods from instances of the <xref:Windows.Storage.IStorageFile> and <xref:Windows.Storage.IStorageFolder> interfaces.
30
+
31
+
The `WindowsRuntimeStorageExtensions` class contains two methods that extend <xref:Windows.Storage.IStorageFile> for reading or writing:
The following example shows how to open a file in the application data as a <xref:System.IO.Stream> in a Windows Store app, and write to it by using an instance of the <xref:System.IO.StreamWriter> class. It then reads the contents for the file by using an instance of the <xref:System.IO.StreamReader> class.
<paramname="windowsRuntimeFile">To be added.</param>
161
-
<summary>To be added.</summary>
162
-
<returns>To be added.</returns>
163
-
<remarks>To be added.</remarks>
188
+
<paramname="windowsRuntimeFile">The Windows Runtime <seecref="T:Windows.Storage.IStorageFile"/> object to read from.</param>
189
+
<summary>Retrieves a stream for reading from a specified file.</summary>
190
+
<returns>A task that represents the asynchronous read operation.</returns>
191
+
<remarks>
192
+
<formattype="text/markdown"><![CDATA[
193
+
## Remarks
194
+
195
+
> [!NOTE]
196
+
> In Visual Basic and C#, you can call this method as an instance method on any object of type <xref:Windows.Storage.IStorageFile>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
197
+
198
+
## Examples
199
+
200
+
The following example shows how to open a file as a <xref:System.IO.Stream> in a Windows Store app, and read its contents by using an instance of the <xref:System.IO.StreamReader> class.
<paramname="rootDirectory">The Windows Runtime <seecref="T:Windows.Storage.IStorageFile" /> object that contains the file to read from.</param>
242
+
<paramname="relativePath">The path, relative to the root folder, to the file to read from.</param>
243
+
<summary>Retrieves a stream for reading from a file in the specified parent folder.</summary>
244
+
<returns>A task that represents the asynchronous read operation.</returns>
245
+
<remarks>
246
+
<formattype="text/markdown"><![CDATA[
247
+
248
+
## Remarks
249
+
250
+
> [!NOTE]
251
+
> In Visual Basic and C#, you can call this method as an instance method on any object of type IStorageFolder. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
252
+
253
+
## Examples
254
+
255
+
The following example shows how to open a file as a <xref:System.IO.Stream> in a Windows Store app, and read its contents by using an instance of the <xref:System.IO.StreamReader> class.
<exceptioncref="T:System.ArgumentNullException"><paramrefname="rootDirectory" /> or <paramrefname="relativePath" /> is <seelangword="null" />.</exception>
267
+
<exceptioncref="T:System.ArgumentException"><paramrefname="relativePath" /> is empty or contains only white-space characters.</exception>
268
+
<exceptioncref="T:System.IO.IOException">The file could not be opened or retrieved as a stream.</exception>
<paramname="windowsRuntimeFile">To be added.</param>
225
-
<summary>To be added.</summary>
226
-
<returns>To be added.</returns>
227
-
<remarks>To be added.</remarks>
296
+
<paramname="windowsRuntimeFile">The Windows Runtime <seecref="T:Windows.Storage.IStorageFile"/> object to write to.</param>
297
+
<summary>Retrieves a stream for writing to a specified file.</summary>
298
+
<returns>A task that represents the asynchronous write operation.</returns>
299
+
<remarks>
300
+
<formattype="text/markdown"><![CDATA[
301
+
## Remarks
302
+
303
+
> [!NOTE]
304
+
> In Visual Basic and C#, you can call this method as an instance method on any object of type <xref:Windows.Storage.IStorageFile>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
305
+
306
+
## Examples
307
+
308
+
The following example shows how to open a file as a <xref:System.IO.Stream> in a Windows Store app, and write to it by using an instance of the <xref:System.IO.StreamReader> class.
<paramname="creationCollisionOption">To be added.</param>
259
-
<summary>To be added.</summary>
260
-
<returns>To be added.</returns>
261
-
<remarks>To be added.</remarks>
349
+
<paramname="rootDirectory">The Windows Runtime <seecref="T:Windows.Storage.IStorageFile"/> object that contains the file to write to.</param>
350
+
<paramname="relativePath">The path, relative to the root folder, to the file to write to.</param>
351
+
<paramname="creationCollisionOption">The Windows Runtime <seecref="T:Windows.Storage.CreationCollisionOption" /> enumeration value that specifies the behavior to use when the name of the file to create is the same as the name of an existing file.</param>
352
+
<summary>Retrieves a stream for writing to a file in the specified parent folder.</summary>
353
+
<returns>A task that represents the asynchronous write operation.</returns>
354
+
<remarks><formattype="text/markdown"><![CDATA[
355
+
356
+
## Remarks
357
+
358
+
> [!NOTE]
359
+
> In Visual Basic and C#, you can call this method as an instance method on any object of type <xref:Windows.Storage.IStorageFolder>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
360
+
361
+
## Examples
362
+
363
+
The following example shows how to open a file as a <xref:System.IO.Stream> in a Windows Store app, and write to it by using an instance of the <xref:System.IO.StreamReader> class.
<exceptioncref="T:System.ArgumentNullException"><paramrefname="rootDirectory" /> or <paramrefname="relativePath" /> is <seelangword="null" />.</exception>
375
+
<exceptioncref="T:System.ArgumentException"><paramrefname="relativePath" /> is empty or contains only white-space characters.</exception>
376
+
<exceptioncref="T:System.IO.IOException">The file could not be opened or retrieved as a stream.</exception>
0 commit comments