Inheritance: Waf.InformationManager.Common.Domain.ValidationModel
Example #1
0
        public void AddAndRemoveEmails()
        {
            var emailDeletionService = new MockEmailDeletionService();
            var emailFolder = new EmailFolder(emailDeletionService);

            Assert.IsFalse(emailFolder.Emails.Any());
            var email1 = new Email();
            
            emailFolder.AddEmail(email1);
            Assert.AreEqual(email1, emailFolder.Emails.Single());

            var email2 = new Email();
            emailFolder.AddEmail(email2);
            Assert.IsTrue(emailFolder.Emails.SequenceEqual(new[] { email1, email2 }));

            bool deleteEmailCalled = false;
            emailDeletionService.DeleteEmailAction = (folder, email) =>
            {
                deleteEmailCalled = true;
                Assert.AreEqual(emailFolder, folder);
                Assert.AreEqual(email1, email);
            };
            emailFolder.RemoveEmail(email1);
            Assert.IsTrue(deleteEmailCalled);
        }
Example #2
0
 public void NotifyEmailDeleted(EmailFolder emailFolder, Email email)
 {
     if (emailFolder != Deleted)
     {
         Deleted.AddEmail(email);
     }
 }
Example #3
0
 public void NotifyEmailDeleted(EmailFolder emailFolder, Email email)
 {
     if (emailFolder != Deleted)
     {
         Deleted.AddEmail(email);    
     }
 }
Example #4
0
        public void DeleteEmail(EmailFolder emailFolder, Email email)
        {
            emailFolder.Emails.Remove(email);

            if (emailFolder != Deleted)
            {
                Deleted.AddEmail(email);
            }
        }
 public EmailClientRoot()
 {
     this.emailAccounts = new ObservableCollection<EmailAccount>();
     this.inbox = new EmailFolder(this);
     this.outbox = new EmailFolder(this);
     this.sent = new EmailFolder(this);
     this.drafts = new EmailFolder(this);
     this.deleted = new EmailFolder(this);
 }
Example #6
0
 public EmailClientRoot()
 {
     this.emailAccounts = new ObservableCollection <EmailAccount>();
     this.inbox         = new EmailFolder();
     this.outbox        = new EmailFolder();
     this.sent          = new EmailFolder();
     this.drafts        = new EmailFolder();
     this.deleted       = new EmailFolder();
     Initialize();
 }
Example #7
0
 public EmailClientRoot()
 {
     emailAccounts = new ObservableCollection <EmailAccount>();
     inbox         = new EmailFolder();
     outbox        = new EmailFolder();
     sent          = new EmailFolder();
     drafts        = new EmailFolder();
     deleted       = new EmailFolder();
     Initialize();
 }
Example #8
0
        private void ShowEmails(EmailFolder emailFolder)
        {
            activeEmailFolderController = container.GetExportedValue<EmailFolderController>();
            activeEmailFolderController.EmailFolder = emailFolder;
            activeEmailFolderController.Initialize();
            activeEmailFolderController.Run();

            ToolBarCommand uiNewEmailCommand = new ToolBarCommand(newEmailCommand, "_New email", 
                "Creates a new email.");
            ToolBarCommand uiDeleteEmailCommand = new ToolBarCommand(activeEmailFolderController.DeleteEmailCommand, "_Delete",
                "Deletes the selected email.");
            ToolBarCommand uiEmailAccountsCommand = new ToolBarCommand(emailAccountsController.EmailAccountsCommand, "_Email accounts",
                "Opens a window that shows the email accounts.");
            shellService.AddToolBarCommands(new[] { uiNewEmailCommand, uiDeleteEmailCommand, uiEmailAccountsCommand });
        }
Example #9
0
 public ItemCountSynchronizer(INavigationNode node, EmailFolder folder)
 {
     this.node = node;
     this.folder = folder;
     AddWeakEventListener((INotifyCollectionChanged)folder.Emails, EmailsCollectionChanged);
     UpdateItemCount();
 }
Example #10
0
 public ItemCountSynchronizer(INavigationNode node, EmailFolder folder)
 {
     this.node = node;
     this.folder = folder;
     CollectionChangedEventManager.AddHandler((INotifyCollectionChanged)folder.Emails, EmailsCollectionChanged);
     UpdateItemCount();
 }
 public void DeleteEmail(EmailFolder emailFolder, Email email)
 {
     DeleteEmailAction(emailFolder, email);
 }
Example #12
0
 public void NotifyEmailDeleted(EmailFolder emailFolder, Email email)
 {
     DeleteEmailAction(emailFolder, email);    
 }