private void ConflateAllAccounts(PdfCreatorSettings settings) { _accounts = settings?.ApplicationSettings?.Accounts; if (_accounts == null) { return; } AllAccounts.Clear(); _accounts.SmtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.SmtpAccounts }); _accounts.DropboxAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.DropboxAccounts }); _accounts.FtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.FtpAccounts }); _accounts.HttpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.HttpAccounts }); _accounts.TimeServerAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.TimeServerAccounts }); RaisePropertyChanged(nameof(AllAccounts)); }
private void ConflateAllAccounts() { if (Accounts == null) { return; } AllAccounts.Clear(); Accounts.SmtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = Accounts.SmtpAccounts }); Accounts.DropboxAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = Accounts.DropboxAccounts }); Accounts.FtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = Accounts.FtpAccounts }); Accounts.HttpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = Accounts.HttpAccounts }); Accounts.TimeServerAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = Accounts.TimeServerAccounts }); RaisePropertyChanged(nameof(AllAccounts)); }