このコードを使用すると、IsolatedStorage を増やしたいかどうかを Silverlight がユーザーに尋ねることができます。
private void Button_IncreaseIsolatedStorage_Click(object sender, RoutedEventArgs e)
{
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
long newStorageCapacityInBytes = FileHelpers.GetMaxiumumSpace() + SystemHelpers.GetAmountOfStorageToIncreaseWhenNeededInBytes();
store.IncreaseQuotaTo(newStorageCapacityInBytes);
Message = "IsolatedStorage increased. " + FileHelpers.GetSpaceLeftMessage();
}
しかし、現在よりも少ない量に設定しようとすると、これは不可能であるというエラーが表示されます。
これに対する回避策はありますか?つまり、IsolatedStorage の量を減らすことはできますか? これは、少なくともテスト目的には役立ちます。
関連する質問:ユーザーが IsolatedStorage を増やすことに同意した場合、他のアプリケーションはこの容量を使用できますか、またはユーザーが容量を増やしたアプリケーションだけを使用できますか? これが上記の制限がある理由だと思います。