Пример #1
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         using (var store = IsolatedStorageFile.GetUserStoreForApplication())
         {
             if (store.Quota < StorageManager.RequiredQuota)
             {
                 // Request more quota space.
                 if (!store.IncreaseQuotaTo(StorageManager.RequiredQuota))
                 {
                     // The user clicked NO to the
                     // host's prompt to approve the quota increase.
                 }
                 else
                 {
                     // The user clicked YES to the
                     // host's prompt to approve the quota increase.
                     StorageManager.AcceptIncrease();
                 }
             }
         }
     }
     catch (IsolatedStorageException)
     {
         // TODO: Handle that store could not be accessed.
     }
     this.DialogResult = true;
 }
Пример #2
0
        private void ShowIncreaseStorageWindow()
        {
            var win = new IncreaseIsoQuotaWindow();

            win.Closed += (o, args) =>
            {
                if (win.DialogResult == true)
                {
                    _hasRequiredQuota = true;
                    StorageManager.AcceptIncrease();
                }
                else
                {
                    StorageManager.DeclineIncrease();
                }
                this.StartLoading();
            };
            win.Show();
        }