Revision 7f5882da trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
42 | 42 |
|
43 | 43 |
|
44 | 44 |
using System.Collections.Concurrent; |
45 |
using System.Collections.Generic; |
|
45 | 46 |
using System.ComponentModel.Composition; |
46 | 47 |
using System.Diagnostics; |
47 | 48 |
using System.IO; |
... | ... | |
280 | 281 |
Settings.Save(); |
281 | 282 |
//SetStartupMode(); |
282 | 283 |
|
284 |
foreach (var account in _accountsToRemove) |
|
285 |
{ |
|
286 |
Settings.Accounts.Remove(account); |
|
287 |
Shell.RemoveMonitor(account.AccountName); |
|
288 |
} |
|
289 |
|
|
283 | 290 |
foreach (var account in Settings.Accounts) |
284 | 291 |
{ |
285 | 292 |
Shell.MonitorAccount(account); |
... | ... | |
374 | 381 |
NotifyOfPropertyChange(()=>Settings); |
375 | 382 |
} |
376 | 383 |
|
384 |
|
|
385 |
readonly List<AccountSettings> _accountsToRemove = new List<AccountSettings>(); |
|
377 | 386 |
public void RemoveAccount() |
378 | 387 |
{ |
379 | 388 |
var accountName = CurrentAccount.AccountName; |
380 |
Settings.Accounts.Remove(CurrentAccount.Account); |
|
381 | 389 |
|
382 | 390 |
Accounts.TryRemove(CurrentAccount); |
383 |
|
|
384 |
|
|
391 |
_accountsToRemove.Add(CurrentAccount.Account); |
|
392 |
|
|
385 | 393 |
CurrentAccount = null; |
386 |
//Accounts = Settings.Accounts; |
|
387 |
//Settings.Save(); |
|
388 |
Shell.RemoveMonitor(accountName); |
|
389 | 394 |
NotifyOfPropertyChange(() => Accounts); |
390 |
NotifyOfPropertyChange(() => Settings); |
|
395 |
|
|
391 | 396 |
|
392 | 397 |
//NotifyOfPropertyChange("Settings.Accounts"); |
393 | 398 |
} |
Also available in: Unified diff