Revision e9eab066 trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs

b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
302 302
            {
303 303
                Settings.Accounts.Add(account);    
304 304
            }
305
            
305

  
306 306
            Settings.Save();
307 307

  
308 308

  
309
            foreach (var account in _accountsToRemove)
309
            try
310 310
            {
311
                Shell.RemoveMonitor(account.AccountName);
312
                Shell.RemoveAccountFromDatabase(account);
313
            }
311
                foreach (var account in _accountsToRemove)
312
                {
313
                    Shell.RemoveMonitor(account.AccountName);
314
                    Shell.RemoveAccountFromDatabase(account);
315
                }
314 316

  
315
            foreach (var account in Settings.Accounts)
316
            {                                
317
                Shell.MonitorAccount(account);
317
                foreach (var account in Settings.Accounts)
318
                {
319
                    Shell.MonitorAccount(account);
320
                }
321
            }                
322
            finally
323
            {
324
                _accountsToRemove.Clear();
325
                _accountsToAdd.Clear();
318 326
            }
319 327

  
320 328
            NotifyOfPropertyChange(()=>Settings);

Also available in: Unified diff