1 // Copyright 2016 by Samsung Electronics, Inc.,
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
10 using System.Collections.Generic;
12 namespace Tizen.System
15 /// Storage Manager, provides properties/ methods to access storage in the device.
17 public static class StorageManager
19 private const string LogTag = "Tizen.System";
22 /// List of all storage in the device
24 public static IEnumerable<Storage> Storages
28 List<Storage> storageList = new List<Storage>();
29 Interop.Storage.StorageDeviceSupportedCallback cb = (int storageID, Interop.Storage.StorageArea type, Interop.Storage.StorageState state, string rootDirectory, IntPtr userData) =>
31 storageList.Add(new Storage(storageID, type, state, rootDirectory));
35 Interop.Storage.ErrorCode err = Interop.Storage.StorageManagerGetForeachDeviceSupported(cb, IntPtr.Zero);
36 if (err != Interop.Storage.ErrorCode.None)
38 Log.Warn(LogTag, string.Format("Failed to get storage list. err = {0}", err));