Ejemplo n.º 1
0
        public MessageListViewModel(
            MessageRepository messageRepository,
            [NotNull] MessageWatcher messageWatcher,
            MimeMessageLoader mimeMessageLoader,
            IPublishEvent publishEvent,
            ILogger logger)
        {
            if (messageRepository == null)
                throw new ArgumentNullException("messageRepository");
            if (messageWatcher == null)
                throw new ArgumentNullException("messageWatcher");
            if (mimeMessageLoader == null)
                throw new ArgumentNullException("mimeMessageLoader");
            if (publishEvent == null)
                throw new ArgumentNullException("publishEvent");

            _messageRepository = messageRepository;
            _messageWatcher = messageWatcher;
            _mimeMessageLoader = mimeMessageLoader;
            _publishEvent = publishEvent;
            _logger = logger;

            SetupMessages();
            RefreshMessageList();
        }
Ejemplo n.º 2
0
        public MimeMessageEntry(MessageEntry entry, MimeMessageLoader loader)
            : base(entry.File)
        {
            IsSelected = entry.IsSelected;

            loader.Get(this).Subscribe(m => { Subject = m.Subject; },
                e =>
                {
                    Subject = "Failure loading message: " + e.Message;
                });
        }