Esempio n. 1
0
 /// <summary>
 /// Set the maximum size of the storage.
 /// </summary>
 /// <remarks>
 /// This only sets the maximum size of the database, but App Center modules might store additional data.
 /// The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
 /// </remarks>
 /// <param name="sizeInBytes">
 /// Maximum size of the storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size (default is 4096 bytes).
 /// Values below 20,480 bytes (20 KiB) will be ignored.
 /// </param>
 /// <returns><code>true</code> if changing the size was successful.</returns>
 public Task <bool> SetMaxStorageSizeAsync(long sizeInBytes)
 {
     return(AddTaskToQueue(() =>
     {
         try
         {
             AppCenterLog.Debug(AppCenterLog.LogTag, $"Set max storage size.");
             return _storageAdapter.SetMaxStorageSize(sizeInBytes);
         }
         catch (Exception e)
         {
             throw new StorageException(e);
         }
     }));
 }