public CleanupService(
     ICurrentProfile Profile,
     IBackupService Backup,
     CloudStorageService Cloud
     ) {
     this.Profile = Profile;
     this.Backup = Backup;
     this.Cloud = Cloud;
 }
        public BackupViewModel(IRepositoryManager repositoryManager,
            IBackupService backupService,
            IDialogService dialogService)
        {
            this.repositoryManager = repositoryManager;
            this.dialogService = dialogService;

            BackupService = backupService;
        }
 public BackupManager(IRepositoryManager repositoryManager,
     IBackupService backupService,
     IMvxFileStore fileStore,
     IDatabaseManager databaseManager)
 {
     this.repositoryManager = repositoryManager;
     this.backupService = backupService;
     this.fileStore = fileStore;
     this.databaseManager = databaseManager;
 }
Beispiel #4
0
        private static void StartConsole(IBackupService backupService)
        {
            backupService.StartBackup();

              while (Console.ReadKey(true).Key != ConsoleKey.Escape)
              {
              }

              backupService.StopBackup();
        }
        public ResourceService(IBackupService backupService, IStorageService storageService, ISettingsService settingsService)
        {
            if (backupService == null) throw new ArgumentNullException(nameof(backupService));
            if (storageService == null) throw new ArgumentNullException(nameof(storageService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _storageService = storageService;
            _settingsService = settingsService;

            backupService.CreatingBackup += (s, e) => CreateBackup(e);
            backupService.RestoringBackup += (s, e) => RestoreBackup(e);
        }
 public BackupManager(IBackupService backupService,
     IMvxFileStore fileStore,
     IDatabaseManager databaseManager,
     ISettingsManager settingsManager,
     IPaymentRepository paymentRepository, 
     IConnectivity connectivity)
 {
     this.backupService = backupService;
     this.fileStore = fileStore;
     this.databaseManager = databaseManager;
     this.settingsManager = settingsManager;
     this.paymentRepository = paymentRepository;
     this.connectivity = connectivity;
 }
        public BackupClient(string endpoint, string authKey, string certificateIdentity)
        {
            // Create a Tcp binding with transport security via x.509 certificate
            NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport);

            // No client credentials are required
            // (The credentials are in the storage account connection strings)
            binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None;

            this.authKey = authKey;

            try
            {
                if (certificateIdentity != null)
                {
                    EndpointAddress address = new EndpointAddress(new Uri(endpoint), new DnsEndpointIdentity(certificateIdentity));
                    this.factory = new ChannelFactory<IBackupService>(binding, address);
                }
                else
                {
                    this.factory = new ChannelFactory<IBackupService>(binding, endpoint);
                }

                // Since certificates do not need to be from a certification authority, set the certificate validation to none
                this.factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;

                this.service = this.factory.CreateChannel();

                // Switch this line with the one above to run the backup service locally
                //this.service = new BackupService(authKey);
            }
            catch (Exception)
            {
                // The specified endpoint is invalid
            }

            this.backup = new Backup();
        }
 public BackupController(IBackupService backupService)
 {
     _backupService = backupService;
 }
 /// <summary>
 ///     Creates a new instance
 /// </summary>
 /// <param name="backupService">Helper for uploading and downloading to the respective backup service.</param>
 /// <param name="repositoryManager">An instance of the repository manager to reload data.</param>
 public AutoBackupManager(IBackupService backupService,
     IRepositoryManager repositoryManager)
 {
     this.backupService = backupService;
     this.repositoryManager = repositoryManager;
 }
Beispiel #10
0
 public BackupHelper(IBackupService backupService)
 {
     this._backupService = backupService;
 }
Beispiel #11
0
 public BackupsController(ICommandBus commandBus, IBackupService backupService)
     : base(commandBus)
 {
     this.backupService = backupService;
 }
Beispiel #12
0
 public void InitWebApi(IBackupService service)
 {
     _webApi?.InitWebApi(service);
 }
 public MainWindowViewModel(ISettingsService settingsService, ISettings settings, IBackupService backupService)
 {
     SettingsVM  = new SettingsViewModel(settingsService, settings);
     DownloadsVM = new DownloadsViewModel(backupService)
     {
         //Backups =
         //{
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123,  DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //    new BackupFile(Guid.NewGuid().ToString(), "uri", 123, DateTime.UtcNow),
         //}
     };
 }
Beispiel #14
0
        public NotesListsViewModel(IEventAggregator eventAggregator, INoteService noteService, IAppearanceService appearanceService, IJumpListService jumpListService, ISearchService searchService, IDialogService dialogService, I18nService i18nService, IBackupService backupService)
        {
            // Injection
            this.eventAggregator   = eventAggregator;
            this.noteService       = noteService;
            this.appearanceService = appearanceService;
            this.jumpListService   = jumpListService;
            this.searchService     = searchService;
            this.dialogService     = dialogService;
            this.i18nService       = i18nService;
            this.backupService     = backupService;

            // PubSub events
            this.eventAggregator.GetEvent <TriggerLoadNoteAnimationEvent>().Subscribe((_) =>
            {
                this.TriggerRefreshNotesAnimation = false;
                this.TriggerRefreshNotesAnimation = true;
            });

            this.eventAggregator.GetEvent <SettingChangeStorageLocationFromMainChangedEvent>().Subscribe((_) => OnPropertyChanged(() => this.ShowChangeStorageLocationButton));
            this.eventAggregator.GetEvent <RefreshJumpListEvent>().Subscribe((_) => this.jumpListService.RefreshJumpListAsync(this.noteService.GetRecentlyOpenedNotes(SettingsClient.Get <int>("Advanced", "NumberOfNotesInJumpList")), this.noteService.GetFlaggedNotes()));

            this.eventAggregator.GetEvent <OpenNoteEvent>().Subscribe(noteTitle =>
            {
                if (!string.IsNullOrEmpty(noteTitle))
                {
                    this.SelectedNote = new NoteViewModel {
                        Title = noteTitle
                    }
                }
                ;
                this.OpenSelectedNote();
            });

            // Event handlers
            this.i18nService.LanguageChanged        += LanguageChangedHandler;
            this.noteService.FlagUpdated            += async(noteId, isFlagged) => { await this.UpdateNoteFlagAsync(noteId, isFlagged); };
            this.noteService.StorageLocationChanged += RefreshAllHandler;
            this.backupService.BackupRestored       += RefreshAllHandler;
            this.noteService.NotesChanged           += (_, __) => Application.Current.Dispatcher.Invoke(() => { this.RefreshNotes(); });
            this.searchService.Searching            += (_, __) => TryRefreshNotesOnSearch();

            // Initialize notebooks
            this.RefreshNotebooks();

            // Initialize notes
            this.NoteFilter = ""; // Must be set before RefreshNotes()
            this.RefreshNotes();

            // Commands
            this.DeleteNoteCommand             = new DelegateCommand <object>(async(obj) => await this.DeleteNoteAsync(obj));
            this.ToggleNoteFlagCommand         = new DelegateCommand <object>((obj) => this.ToggleNoteFlag(obj));
            this.DeleteNotebookCommand         = new DelegateCommand <object>((obj) => this.DeleteNotebook(obj));
            this.EditNotebookCommand           = new DelegateCommand <object>((obj) => this.EditNotebook(obj));
            this.DeleteSelectedNotebookCommand = new DelegateCommand(() => this.DeleteSelectedNotebook());
            this.EditSelectedNotebookCommand   = new DelegateCommand(() => this.EditSelectedNotebook());
            this.DeleteSelectedNoteCommand     = new DelegateCommand(async() => await this.DeleteSelectedNoteAync());
            this.ChangeStorageLocationCommand  = new DelegateCommand(async() => await this.ChangeStorageLocationAsync(false));
            this.ResetStorageLocationCommand   = new DelegateCommand(async() => await this.ChangeStorageLocationAsync(true));

            this.NewNotebookCommand = new DelegateCommand <string>((_) => this.NewNotebook());
            Common.Prism.ApplicationCommands.NewNotebookCommand.RegisterCommand(this.NewNotebookCommand);

            this.NewNoteCommand = new DelegateCommand <object>(param => this.NewNote(param));
            Common.Prism.ApplicationCommands.NewNoteCommand.RegisterCommand(this.NewNoteCommand);

            this.ImportNoteCommand = new DelegateCommand <string>((x) => this.ImportNote());
            Common.Prism.ApplicationCommands.ImportNoteCommand.RegisterCommand(this.ImportNoteCommand);

            this.NavigateBetweenNotesCommand = new DelegateCommand <object>(NavigateBetweenNotes);
            Common.Prism.ApplicationCommands.NavigateBetweenNotesCommand.RegisterCommand(this.NavigateBetweenNotesCommand);

            // Process jumplist commands
            this.ProcessJumplistCommands();
        }
 public BackupModule(IBackupService service)
 {
     _service = service;
 }
Beispiel #16
0
        public TasksPresenter(IApplicationController controller, ITasksView view, ITaskService taskService, IBackupService backupService) : base(controller, view)
        {
            this.taskService = taskService;
            tasks            = taskService.GetAllTasks();
            View.Tasks       = tasks;
            View.RemoveTask += async(id) => await View_RemoveTask(id);

            View.OpenTask           += View_OpenTask;
            View.Reload             += View_Reload;
            View.CreateNewJobAction += View_CreateNewTaskAction;
            View.Show();
            this.backupService = backupService;
        }
 public CreateFullBackup(IBackupService <FullBackup> backupService)
 {
     this.backupService = backupService;
 }
		public AdminServicesController(IBackupService backupService)
		{
			this.backupService = backupService;
		}
        public GamesViewModel(IRegionManager regionManager, IDataAccess dataAccess, IEventAggregator eventAggregator, IBackupService backupService) : base(regionManager, eventAggregator)
        {
            _dataAccess    = dataAccess;
            _backupService = backupService;

            RefreshCommand     = new DelegateCommand(LoadGames);
            AddCommand         = new DelegateCommand(() => OpenGameDialog(0));
            EditCommand        = new DelegateCommand <Game>(x => OpenGameDialog(x.Id));
            MakeCurrentCommand = new DelegateCommand <Game>(MakeCurrent);
            RemoveCommand      = new DelegateCommand <Game>(Remove);
        }
 public Handler(IContextAdapter contextAdapter, IBackupService backupService)
 {
     this.contextAdapter = contextAdapter;
     this.backupService  = backupService;
 }
Beispiel #21
0
 public OnRepoBackupFailed(string repoName, IBackupService service)
 {
     Repo          = repoName;
     BackupService = service;
 }
 public PanelController(IPostService postService, IBackupService backupService, IFormFileUploadService uploadService)
 {
     PostService   = postService;
     BackupService = backupService;
     UploadService = uploadService;
 }
Beispiel #23
0
 public OnRepoStartBackup(string repoName, IBackupService service)
 {
     Repo          = repoName;
     BackupService = service;
 }
Beispiel #24
0
 public BackupController(IBackupService backupService)
 {
     this.backupService = backupService;
     this.backupService.Initialiaze(System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString, dbName);
     backupFilePath = HttpContext.Current.Server.MapPath(backupFolder);
 }
Beispiel #25
0
 public App(IBackupService backupService, IConfigurationRoot config, ILogger <App> logger)
 {
     _backupService = backupService;
     _logger        = logger;
     _config        = config;
 }
 public DatabaseBackupperService(IScheduleService scheduleService, ITaskService taskService, IBackupService backupService)
 {
     InitializeComponent();
     this.scheduleService = scheduleService;
     this.taskService     = taskService;
     this.backupService   = backupService;
 }
Beispiel #27
0
        public override void OnViewLoaded(ActionExecutionContext e)
        {
            UpdateAccounts();

            SelectedAccount = BackupAccounts.FirstOrDefault();
        }
Beispiel #28
0
        protected BackupRestoreModel(
            IApplicationSettingService applicationSettingService,
            IBitnamiRedmineService bitnamiRedmineService,
            IBackupService backupService,
            IDispatcherService dispatcherService,
            IDialogService dialogService,
            ILogService logService,
            BitnamiRedmineStack stack)
        {
            if (applicationSettingService == null)
            {
                throw new ArgumentNullException(nameof(applicationSettingService));
            }

            if (bitnamiRedmineService == null)
            {
                throw new ArgumentNullException(nameof(bitnamiRedmineService));
            }

            if (backupService == null)
            {
                throw new ArgumentNullException(nameof(backupService));
            }

            if (dispatcherService == null)
            {
                throw new ArgumentNullException(nameof(dispatcherService));
            }

            if (dialogService == null)
            {
                throw new ArgumentNullException(nameof(dialogService));
            }

            if (logService == null)
            {
                throw new ArgumentNullException(nameof(logService));
            }

            if (stack == null)
            {
                throw new ArgumentNullException(nameof(stack));
            }

            this._ApplicationSettingService = applicationSettingService;
            this._BitnamiRedmineService     = bitnamiRedmineService;
            this._BackupService             = backupService;
            this._DispatcherService         = dispatcherService;
            this._DialogService             = dialogService;
            this._LogService = logService;
            this._Stack      = stack;

            this.Database = true;
            this.Files    = true;
            this.Plugins  = true;
            this.Themes   = true;

            this.Command = new RelayCommand(this.Execute, this.CanExecute);
            this.SelectDirectoryCommand = new RelayCommand(this.ExecuteSelectDirectory, this.CanExecuteSelectDirectory);

            //var bitNamiRedmineStackConfiguration = ConfigurationService.Instance.GetBitnamiRedmineStackConfiguration(stack.DisplayVersion);
            //bitNamiRedmineStackConfiguration.
        }
Beispiel #29
0
 public CleanupService(ICacheService cacheService, ILogger <CleanupService> logger, IBackupService backupService)
 {
     _cacheService  = cacheService;
     _logger        = logger;
     _backupService = backupService;
 }
Beispiel #30
0
 public BackupModule(IBackupService backupService) : base("system/backup")
 {
     _backupService = backupService;
     GetResourceAll = GetBackupFiles;
 }
 public BackupController(IBackupService backupService, IAuthService authService)
 {
     _backupService = backupService;
     _authService   = authService;
 }
 public BackupTimeService(ILogger <BackupTimeService <T> > logger, IOptions <T> options, IBackupService <T> backupService)
 {
     _logger        = logger;
     _backupService = backupService;
     _settings      = options.Value ?? throw new BackupSettingsNotRegisteredException();
 }
Beispiel #33
0
        private static void StartService(IBackupService backupService)
        {
            HostFactory.Run(x =>
              {
            x.Service<IBackupService>(s =>
            {
              s.ConstructUsing(name => backupService);
              s.WhenStarted(b => b.StartBackup());
              s.WhenStopped(b => b.StopBackup());
            });
            x.RunAsLocalSystem();

            x.SetDescription("Simple Backup");
            x.SetDisplayName("Simple Backup");
            x.SetServiceName("SimpleBackup");
              });
        }
Beispiel #34
0
 public AdminController(IDeploymentService deploymentService, IBackupService backupService)
 {
     _deploymentService = deploymentService;
     _backupService     = backupService;
 }
Beispiel #35
0
 public Handler(IContextAdapter contextAdapter, IBackupService backupService, ISettingsFacade settingsFacade)
 {
     this.contextAdapter = contextAdapter;
     this.backupService  = backupService;
     this.settingsFacade = settingsFacade;
 }
Beispiel #36
0
 public BackupFileMapper(IBackupService backupService, IDiskProvider diskProvider, Logger logger)
     : base(diskProvider, logger)
 {
     _backupService = backupService;
 }
Beispiel #37
0
 public BaseViewModel(IDataService dataService, IMvxMessenger messenger, IBackupService oneDriveService)
 {
     _dataService     = dataService;
     _messenger       = messenger;
     _oneDriveService = oneDriveService;
 }
Beispiel #38
0
 public BackupTaskLauncher(IBackupService backupFileService, IFileFactory fileFactory, BackupServiceSettings settings)
 {
     this.backupFileService = backupFileService;
     this.fileFactory       = fileFactory;
     this.settings          = settings;
 }
Beispiel #39
0
 public BackupsController(IDatabaseService databaseService, IBackupService backupService)
 {
     _databaseService = databaseService;
     _backupService   = backupService;
 }
Beispiel #40
0
 public Backup(IBackupService backupService)
 {
     this.backupService = backupService;
 }
        public ShoppingListViewModel(IDataService dataService, IMvxMessenger messenger, IBackupService oneDriveService)
            : base(dataService, messenger, oneDriveService)
        {
            _dataService = dataService;
            _messenger   = messenger;

            // Only register message once (prevents multiple calls)
            if (_messenger.CountSubscriptionsFor <ShoppingItemQuantityUpMessage>() == 0)
            {
                _upToken = _messenger.Subscribe <ShoppingItemQuantityUpMessage>(message =>
                {
                    ShoppingItemQuantityUpCommand.Execute(message.ShoppingItem);
                });
            }

            if (_messenger.CountSubscriptionsFor <ShoppingItemQuantityDownMessage>() == 0)
            {
                _downToken = _messenger.Subscribe <ShoppingItemQuantityDownMessage>(message =>
                {
                    ShoppingItemQuantityDownCommand.Execute(message.ShoppingItem);
                });
            }

            if (_messenger.CountSubscriptionsFor <ShoppingItemCheckedMessage>() == 0)
            {
                _checkedToken = _messenger.Subscribe <ShoppingItemCheckedMessage>(message =>
                {
                    ShoppingItemCheckedCommand.Execute(message.ShoppingItem);
                });
            }

            _refreshToken = _messenger.Subscribe <CollectionChangedMessage>(Refresh);

            ShoppingItems = _dataService.AllShoppingItems();
        }