Class Storage
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.Storage.dll
- API Level:
- 3
The class to access the storage device information.
public class Storage
- Inheritance
-
Storage
Properties
View SourceAvailableSpace
The available storage size in bytes.
Declaration
public ulong AvailableSpace { get; }
Property Value
Type | Description |
---|---|
UInt64 |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceAvaliableSpace
[Obsolete("Please do not use! this will be deprecated")]
Declaration
[Obsolete("Please do not use! This will be deprecated! Please use AvailableSpace instead!")]
public ulong AvaliableSpace { get; }
Property Value
Type | Description |
---|---|
UInt64 |
API Level: 3
View SourceDeviceType
The StorageDevice.
Declaration
public StorageDevice DeviceType { get; }
Property Value
Type | Description |
---|---|
StorageDevice |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when DeviceType is not initialized. |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceFlags
The flags for the storage status.
Declaration
public int Flags { get; }
Property Value
Type | Description |
---|---|
Int32 |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when flags are not initialized. |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceFstype
The type of file system.
Declaration
public string Fstype { get; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when Fstype is not initialized. |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceFsuuid
The UUID of the file system.
Declaration
public string Fsuuid { get; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when Fsuuid is not initialized. |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceId
The storage ID.
Declaration
public int Id { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 3
Feature: http://tizen.org/feature/storage.external
View SourcePrimary
Information whether this is a primary partition.
Declaration
public bool Primary { get; }
Property Value
Type | Description |
---|---|
Boolean |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when primary is not initialized. |
API Level: 5
Feature: http://tizen.org/feature/storage.external
View SourceRootDirectory
The root directory for the storage.
Declaration
public string RootDirectory { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 3
Feature: http://tizen.org/feature/storage.external
View SourceState
The StorageState.
Declaration
public StorageState State { get; }
Property Value
Type | Description |
---|---|
StorageState |
API Level: 3
Feature: http://tizen.org/feature/storage.external
View SourceStorageType
The type of storage.
Declaration
public StorageArea StorageType { get; }
Property Value
Type | Description |
---|---|
StorageArea |
API Level: 3
Feature: http://tizen.org/feature/storage.external
View SourceTotalSpace
The total storage size in bytes.
Declaration
public ulong TotalSpace { get; }
Property Value
Type | Description |
---|---|
UInt64 |
API Level: 3
Feature: http://tizen.org/feature/storage.external
Methods
View SourceGetAbsolutePath(DirectoryType)
Absolute path for a given directory type in the storage.
Declaration
public string GetAbsolutePath(DirectoryType dirType)
Parameters
Type | Name | Description |
---|---|---|
DirectoryType | dirType | Directory type. |
Returns
Type | Description |
---|---|
String | Absolute path for a given directory type in the storage. |
Remarks
The returned directory path may not exist, so you must make sure that it exists before using it. For accessing internal storage except the ringtones directory, the application should have http://tizen.org/privilege/mediastorage privilege. For accessing ringtones directory, the application should have http://tizen.org/privilege/systemsettings privilege. For accessing external storage, the application should have http://tizen.org/privilege/externalstorage privilege.
Examples
// To get the video directories for all the supported storage,
var storageList = StorageManager.Storages as List<Storage>;
foreach (var storage in storageList)
{
string pathForVideoDir = storage.GetAbsolutePath(DirectoryType.Videos);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when failed because of an invalid argument. |
OutOfMemoryException | Thrown when failed due to out of memory exception. |
NotSupportedException | Thrown when the storage is not supported or the application does not have the permission to access the directory path. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/mediastoragehttp://tizen.org/privilege/systemsettingshttp://tizen.org/privilege/externalstorage
Feature: http://tizen.org/feature/storage.external
Events
View SourceStorageStateChanged
StorageStateChanged event. This event is occurred when a storage state changes.
Declaration
public event EventHandler StorageStateChanged
Event Type
Type | Description |
---|---|
EventHandler |
Remarks
The storage state will be updated before calling the event handler.
Examples
myStorage.StorageStateChanged += (s, e) =>
{
var storage = s as Storage;
Console.WriteLine(string.Format("State Changed to {0}", storage.State));
}