public MBoxAccountDataContext(MboxAccount account, Action <MboxMailbox> removeMailboxAction) { _account = account; Mailboxes = new MboxMailboxList(removeMailboxAction, Dispatcher.CurrentDispatcher); Mailboxes.SetList(account.Mailboxes.UnderlyingCollection); //Mailboxes.CollectionChanged += (sender, args) => OnPropertyChanged("Mailboxes"); }
private void AddAccountClick(object sender, RoutedEventArgs e) { if (SourceComboBox.SelectedItem != null) { IMailAccount account = null; if ("Imap".Equals(((ComboBoxItem)(SourceComboBox.SelectedItem)).Content)) { account = new ImapAccount(); } else if ("Mbox".Equals(((ComboBoxItem)(SourceComboBox.SelectedItem)).Content)) { account = new MboxAccount(); } else if ("Exchange".Equals(((ComboBoxItem)(SourceComboBox.SelectedItem)).Content)) { account = new ExchangeAccount(); } else { Logger.Warn("Unsupported Account '" + ((ComboBoxItem)(SourceComboBox.SelectedItem)).Content + "'"); } if (account != null) { account.AddedMailbox += AddMailboxEvent; account.RemovedMailbox += RemoveMailboxEvent; MailSources.Add(account); } } }
public MboxAccountControl(MboxAccount account) { InitializeComponent(); Account = account; account.Mailboxes.CollectionChanged += MailboxesOnCollectionChanged; _dataContext = new MBoxAccountDataContext(account, RemoveMailboxFunction); DataContext = _dataContext; }
public MboxMailbox(MboxAccount account) { _account = account; Folders = new ObservableCollection <MboxFolder>(); }