Skip to main content

IStorageFolder Interface

Definition

Assembly:Avalonia.Base
Package:Avalonia

Manipulates folders and their contents, and provides information about them.

public interface IStorageFolder

Implements: IStorageItem, IDisposable

Methods

NameDescription
CreateFileAsyncCreates a file with specified name as a child of the current storage folder
CreateFolderAsyncCreates a folder with specified name as a child of the current storage folder
GetFileAsyncGets the file with the specified name from the current folder.
GetFolderAsyncGets the folder with the specified name from the current folder.
GetItemsAsyncGets the files and subfolders in the current folder.

CreateFileAsync Method

Creates a file with specified name as a child of the current storage folder

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFile> CreateFileAsync(string name)

Parameters

name string

The display name

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFile>

A new Avalonia.Platform.Storage.IStorageFile pointing to the moved file. If not null, the current storage item becomes invalid

CreateFolderAsync Method

Creates a folder with specified name as a child of the current storage folder

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder> CreateFolderAsync(string name)

Parameters

name string

The display name

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder>

A new Avalonia.Platform.Storage.IStorageFolder pointing to the moved file. If not null, the current storage item becomes invalid

GetFileAsync Method

Gets the file with the specified name from the current folder.

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFile> GetFileAsync(string name)

Parameters

name string

The name of the file to get

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFile>

When this method completes successfully, it returns the file with the specified name from the current folder.

GetFolderAsync Method

Gets the folder with the specified name from the current folder.

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder> GetFolderAsync(string name)

Parameters

name string

The name of the folder to get

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder>

When this method completes successfully, it returns the folder with the specified name from the current folder.

GetItemsAsync Method

Gets the files and subfolders in the current folder.

public System.Collections.Generic.IAsyncEnumerable<Avalonia.Platform.Storage.IStorageItem> GetItemsAsync()

Returns

System.Collections.Generic.IAsyncEnumerable<Avalonia.Platform.Storage.IStorageItem>

When this method completes successfully, it returns a list of the files and folders in the current folder. Each item in the list is represented by an Avalonia.Platform.Storage.IStorageItem implementation object.