ManageEmailSourceViewModel(IManageEmailSourceModel updateManager, IEventAggregator aggregator)
     : base("EmailSource")
 {
     VerifyArgument.IsNotNull("updateManager", updateManager);
     VerifyArgument.IsNotNull("aggregator", aggregator);
     _updateManager = updateManager;
     SendCommand    = new DelegateCommand(o => TestConnection(), o => CanTest());
     OkCommand      = new DelegateCommand(o => SaveConnection(), o => CanSave());
     Testing        = false;
     _testPassed    = false;
     _testFailed    = false;
 }
 public ManageEmailSourceViewModel(IManageEmailSourceModel updateManager, IEventAggregator aggregator, IEmailServiceSource emailServiceSource, IAsyncWorker asyncWorker)
     : this(updateManager, aggregator)
 {
     VerifyArgument.IsNotNull("emailServiceSource", emailServiceSource);
     asyncWorker.Start(() => updateManager.FetchSource(emailServiceSource.Id), source =>
     {
         _emailServiceSource      = source;
         _emailServiceSource.Path = emailServiceSource.Path;
         FromModel(_emailServiceSource);
         Item = ToModel();
         SetupHeaderTextFromExisting();
     });
 }
 public ManageEmailSourceViewModel(IManageEmailSourceModel updateManager, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator)
     : this(updateManager, aggregator)
 {
     VerifyArgument.IsNotNull("requestServiceNameViewModel", requestServiceNameViewModel);
     _updateManager = updateManager;
     RequestServiceNameViewModel = requestServiceNameViewModel;
     HeaderText  = Resources.Languages.Core.EmailSourceNewHeaderLabel;
     Header      = Resources.Languages.Core.EmailSourceNewHeaderLabel;
     HostName    = string.Empty;
     UserName    = string.Empty;
     Password    = string.Empty;
     EnableSend  = false;
     EnableSslNo = true;
     Port        = 25;
     Timeout     = 10000;
 }