Example #1
0
 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");
 }
Example #2
0
 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);
         }
     }
 }
Example #3
0
 public MboxAccountControl(MboxAccount account)
 {
     InitializeComponent();
     Account = account;
     account.Mailboxes.CollectionChanged += MailboxesOnCollectionChanged;
     _dataContext = new MBoxAccountDataContext(account, RemoveMailboxFunction);
     DataContext  = _dataContext;
 }
Example #4
0
 public MboxMailbox(MboxAccount account)
 {
     _account = account;
     Folders  = new ObservableCollection <MboxFolder>();
 }