예제 #1
0
 private void OnConnectFailed(Account account)
 {
     if (MessageBox.Show("EditAccountPage_Confirm_Store".Translate(account.Protocol, account.ServerDomain), "EditAccountPage_Confirm_Store_Caption".Translate(), MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         StoreAccount(account);
     }
 }
 /// <summary>
 /// Try to display contents of the file.
 /// The action can fail depending on the file type and size, then the default icon view will be generated.
 /// Must be created an refreshed linear (no async!) as it would raise I/O-Exceptions.
 /// 
 /// </summary>
 /// <param name="info">Associated Account info</param>
 /// <param name="file">Desired file</param>
 /// <param name="preview">If the current environment does not allow previews (remote view, no WLAN,) set this to false</param>
 public FileMultiTileViewControl(Account info, File file, bool preview)
 {
     InitializeComponent();
     _enabled = preview;
     _info = info;
     _file = file;
     this.FileName.Text = file.FileName;
     RefreshPreview(file);
 }
예제 #3
0
 private void OnConnectTestComplete(bool success, Account account)
 {
     Dispatcher.BeginInvoke(() =>
     {
         _overlay.Hide();
         if (success)
         {
             StoreAccount(account);
         }
         else
         {
             OnConnectFailed(account);
         }
     });
 }
예제 #4
0
 private void PageLoaded(object sender, RoutedEventArgs e)
 {
     try
     {
         _workingAccount = App.DataContext.LoadAccount(NavigationContext.QueryString["account"]);
         _workingAccount.RestoreCredentials();
     }
     catch (Exception)
     {
         // should not happen
     }
     ApplicationBar = (ApplicationBar)Resources["DefaultAppBar"];
     ApplicationBar.TranslateButtons();
     FetchStructure(_workingAccount.WebDAVPath);
 }
예제 #5
0
 public AsyncHttpResponse(HttpWebRequest request, Account account)
 {
     Request = request;
     AssociatedAccount = account;
 }
예제 #6
0
        private void StoreAccount(Account account)
        {

            // encrypt data
            account.StoreCredentials();

            // edit/insert
            if (!_editMode) {
                App.DataContext.Accounts.InsertOnSubmit(account);  
            }
            App.DataContext.SubmitChanges();

            // temporary data can be deleted
            _accountForm.Remove(_editMode ? "EditAccountForm" : "AddAccountForm");
            NavigationService.GoBack();
        }
예제 #7
0
        private void PageLoaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = App.DataContext.EnablePhoneStatusBar;
            try
            {
                _workingAccount = App.DataContext.LoadAccount(NavigationContext.QueryString["account"]);
                _workingAccount.RestoreCredentials();
            }
            catch (Exception)
            {
                // should not happen
            }

            FetchStructure(_workingAccount.WebDAVPath);
        }