Revision c636df1f trunk/Pithos.Client.WPF/Preferences/AddAccountViewModel.cs

b/trunk/Pithos.Client.WPF/Preferences/AddAccountViewModel.cs
41 41
#endregion
42 42
using System;
43 43
using System.Collections.Generic;
44
using System.ComponentModel;
45 44
using System.ComponentModel.Composition;
46
using System.IO;
47
using System.Linq;
48
using System.Net;
49
using System.Text;
50 45
using System.Threading.Tasks;
51 46
using System.Windows;
52
using System.Windows.Controls;
53 47
using System.Windows.Forms;
54
using Caliburn.Micro;
55 48
using Pithos.Client.WPF.Properties;
56
using Pithos.Core;
57 49
using Pithos.Network;
58 50
using MessageBox = System.Windows.MessageBox;
59 51
using Screen = Caliburn.Micro.Screen;
......
178 170

  
179 171
        public void SelectAccount()
180 172
        {
181
            using (var dlg = new FolderBrowserDialog{Description="Please select a folder to store local files. Pithos will create a new folder called Okeanos under the folder you specify."})
173
            using (var dlg = new FolderBrowserDialog{Description=Resources.AddAccountViewModel_SelectAccount_Please_select_a_folder})
182 174
            {
183 175
                //Ask the user to select a folder
184 176
                //Note: We need a parent window here, which we retrieve with GetView            
......
219 211
            {
220 212
                ClearBusy();
221 213
                
222
                (this.GetView() as Window).Activate();
214
                ((Window) GetView()).Activate();
223 215
            }
224 216

  
225 217
        }
......
310 302
            {
311 303
                SetBusy("Validating Credentials", "");
312 304
                var client = new CloudFilesClient(AccountName, Token) { AuthenticationUrl = CurrentServer,/*Proxy=Proxy */};                
313
                var containers = await TaskEx.Run(() =>
314
                                                      {
315
                                                          client.Authenticate();
316
                                                          return client.ListContainers(AccountName);
317
                                                      });
305
                await TaskEx.Run(() =>
306
                                     {
307
                                         client.Authenticate();
308
                                         return client.ListContainers(AccountName);
309
                                     });
318 310
                HasValidCredentials = true;
319 311
                ValidationMessage = "Credentials Validated";
320 312
            }
321
/*
322
            catch (AggregateException exc)
323
            {
324
                exc.Handle(ex=>
325
                               {
326
                                   HasValidCredentials = false;
327
                                   MessageBox.Show("The account is not valid", "Account Error", MessageBoxButton.OK, MessageBoxImage.Stop);                                                   
328
                               });
329
            }
330
*/
331 313
            catch
332 314
            {
333 315
                HasValidCredentials = false;

Also available in: Unified diff