IStorageItem Interface
Definition
Manipulates storage items (files and folders) and their contents, and provides information about them
public interface IStorageItem
Remarks
This interface inherits IDisposable . It's recommended to dispose Avalonia.Platform.Storage.IStorageItem when it's not used anymore.
Methods
| Name | Description |
|---|---|
| DeleteAsync | Deletes the current storage item and it's contents |
| GetBasicPropertiesAsync | Gets the basic properties of the current item. |
| GetParentAsync | Gets the parent folder of the current storage item. |
| MoveAsync | Moves the current storage item and it's contents to a Avalonia.Platform.Storage.IStorageFolder |
| SaveBookmarkAsync | Saves items to a bookmark. |
DeleteAsync Method
Deletes the current storage item and it's contents
public System.Threading.Tasks.Task DeleteAsync()
Returns
System.Threading.Tasks.Task
GetBasicPropertiesAsync Method
Gets the basic properties of the current item.
public System.Threading.Tasks.Task<Avalonia.Platform.Storage.StorageItemProperties> GetBasicPropertiesAsync()
Returns
System.Threading.Tasks.Task<Avalonia.Platform.Storage.StorageItemProperties>
GetParentAsync Method
Gets the parent folder of the current storage item.
public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder> GetParentAsync()
Returns
System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder>
MoveAsync Method
Moves the current storage item and it's contents to a Avalonia.Platform.Storage.IStorageFolder
public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageItem> MoveAsync(Avalonia.Platform.Storage.IStorageFolder destination)
Parameters
destination Avalonia.Platform.Storage.IStorageFolder
The Avalonia.Platform.Storage.IStorageFolder to move the item into
Returns
System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageItem>
SaveBookmarkAsync Method
Saves items to a bookmark.
public System.Threading.Tasks.Task<string> SaveBookmarkAsync()
Returns
System.Threading.Tasks.Task<string>
Returns identifier of a bookmark. Can be null if OS denied request.
Properties
| Name | Description |
|---|---|
| CanBookmark | Returns true is item can be bookmarked and reused later. |
| Name | Gets the name of the item including the file name extension if there is one. |
| Path | Gets the file-system path of the item. |
CanBookmark Property
Returns true is item can be bookmarked and reused later.
public bool CanBookmark { get; set; }
Name Property
Gets the name of the item including the file name extension if there is one.
public string Name { get; set; }
Path Property
Gets the file-system path of the item.
public Uri Path { get; set; }
Remarks
Android backend might return file path with "content:" scheme. Browser and iOS backends might return relative uris.