public PublishersViewModel(IEventAggregator eventAggregator,
                                   IPublisherLookupDataService publisherLookupDataService)
            : base(eventAggregator)
        {
            this.publisherLookupDataService = publisherLookupDataService
                                              ?? throw new ArgumentNullException(nameof(publisherLookupDataService));

            Init();
        }
Beispiel #2
0
        public BookDetailViewModel(IEventAggregator eventAggregator,
                                   IMetroDialogService metroDialogService,
                                   IRepository <Book> booksRepo,
                                   ILanguageLookupDataService languageLookupDataService,
                                   IPublisherLookupDataService publisherLookupDataService,
                                   IAuthorLookupDataService authorLookupDataService,
                                   IFormatLookupDataService formatLookupDataService,
                                   IGenreLookupDataService genreLookupDataService)
            : base(eventAggregator, metroDialogService)
        {
            this.languageLookupDataService = languageLookupDataService
                                             ?? throw new ArgumentNullException(nameof(languageLookupDataService));
            this.publisherLookupDataService = publisherLookupDataService
                                              ?? throw new ArgumentNullException(nameof(publisherLookupDataService));
            this.authorLookupDataService = authorLookupDataService
                                           ?? throw new ArgumentNullException(nameof(authorLookupDataService));
            this.formatLookupDataService = formatLookupDataService
                                           ?? throw new ArgumentNullException(nameof(formatLookupDataService));
            this.genreLookupDataService = genreLookupDataService
                                          ?? throw new ArgumentNullException(nameof(genreLookupDataService));

            HighlightMouseOverCommand          = new DelegateCommand(HighlightMouseOverExecute);
            HighlightMouseLeaveCommand         = new DelegateCommand(HighlightMouseLeaveExecute);
            SetReadDateCommand                 = new DelegateCommand(SetReadDateExecute);
            AddBookCoverImageCommand           = new DelegateCommand(AddBookCoverImageExecute);
            AddAuthorAsABookAuthorCommand      = new DelegateCommand <LookupItem>(AddBookAuthorExecute);
            AddNewAuthorCommand                = new DelegateCommand(OnAddNewAuthorExecute);
            AddNewPublisherCommand             = new DelegateCommand(OnAddNewPublisherExecute);
            AddNewLanguageCommand              = new DelegateCommand(OnAddNewLanguageExecute);
            RemoveAuthorAsABookAuthorCommand   = new DelegateCommand <Guid?>(RemoveAuthorExecute);
            LanguageSelectionChangedCommand    = new DelegateCommand(OnLanguageSelectionChangedExecute);
            PublisherSelectionChangedCommand   = new DelegateCommand(OnPublisherSelectionChangedExecute);
            RemoveDateAsABookReadDateCommand   = new DelegateCommand <DateTime?>(OnRemoveDateAsABookReadDateExecute);
            ReleaseYearSelectionChangedCommand = new DelegateCommand(OnReleaseYearSelectionChangedExecute);
            ShowSelectedPublisherCommand
                = new DelegateCommand <Guid?>(OnShowSelectedPublisherExecute, OnShowSelectedPublisherCanExecute);
            ShowSelectedAuthorCommand         = new DelegateCommand <Guid?>(OnShowSelectedAuthorExecute, OnShowSelectedAuthorCanExecute);
            ShowSelectedSeriesCommand         = new DelegateCommand <Guid?>(OnShowSelectedSeriesExecute, OnShowSelectedSeriesCanExecute);
            BookFormatSelectionChangedCommand = new DelegateCommand <LookupItem>(OnBookFormatSelectionChangedExecute);
            BookGenreSelectionChangedCommand  = new DelegateCommand <LookupItem>(OnBookGenreSelectionChangedExecute);

            Repository = booksRepo ?? throw new ArgumentNullException(nameof(booksRepo));

            NewReadDate    = DateTime.Today;
            Languages      = new ObservableCollection <LookupItem>();
            Publishers     = new ObservableCollection <LookupItem>();
            Authors        = new ObservableCollection <LookupItem>();
            AllBookFormats = new ObservableCollection <Tuple <LookupItem, bool> >();
            AllBookGenres  = new ObservableCollection <Tuple <LookupItem, bool> >();
            SelectedItem   = new Book();

            YearsList = PopulateYearsMenu();
        }
        public PublishersViewModel(IEventAggregator eventAggregator,
                                   IPublisherLookupDataService publisherLookupDataService,
                                   ILogger logger,
                                   IDialogService dialogService)
            : base(eventAggregator, logger, dialogService)
        {
            this.publisherLookupDataService = publisherLookupDataService
                                              ?? throw new ArgumentNullException(nameof(publisherLookupDataService));

            Init();

            ViewModelType = nameof(PublisherDetailViewModel);
        }
Beispiel #4
0
        public PublishersViewModel(IEventAggregator eventAggregator,
                                   IPublisherLookupDataService publisherLookupDataService,
                                   ILogger logger,
                                   IDialogService dialogService)
            : base(eventAggregator, logger, dialogService)
        {
            _publisherLookupDataService = publisherLookupDataService
                                          ?? throw new ArgumentNullException(nameof(publisherLookupDataService));

            MaintenanceFilters      = GetMaintenanceFilters();
            ActiveMaintenanceFilter = MaintenanceFilters.First();

            Init().Await();

            ViewModelType = nameof(PublisherDetailViewModel);
        }
Beispiel #5
0
 public BookService(IRepository <Book, BookId> repository,
                    ILanguageLookupDataService languageLookupDataService   = null,
                    IPublisherLookupDataService publisherLookupDataService = null,
                    IAuthorLookupDataService authorLookupDataService       = null,
                    IFormatLookupDataService formatLookupDataService       = null,
                    IGenreLookupDataService genreLookupDataService         = null,
                    IGenreService genreService   = null,
                    IFormatService formatService = null)
 {
     Repository = repository ?? throw new ArgumentNullException(nameof(repository));
     _languageLookupDataService  = languageLookupDataService;
     _publisherLookupDataService = publisherLookupDataService;
     _authorLookupDataService    = authorLookupDataService;
     _formatLookupDataService    = formatLookupDataService;
     _genreLookupDataService     = genreLookupDataService;
     _genreService  = genreService;
     _formatService = formatService;
 }
 public BookService(IRepository <Book> repository,
                    IFormatRepository formatRepository,
                    IGenreRepository genreRepository,
                    ILanguageLookupDataService languageLookupDataService,
                    IPublisherLookupDataService publisherLookupDataService,
                    IAuthorLookupDataService authorLookupDataService,
                    IFormatLookupDataService formatLookupDataService,
                    IGenreLookupDataService genreLookupDataService)
 {
     Repository = repository ?? throw new ArgumentNullException(nameof(repository));
     this.languageLookupDataService  = languageLookupDataService ?? throw new ArgumentNullException(nameof(languageLookupDataService));
     this.publisherLookupDataService = publisherLookupDataService ?? throw new ArgumentNullException(nameof(publisherLookupDataService));
     this.authorLookupDataService    = authorLookupDataService ?? throw new ArgumentNullException(nameof(authorLookupDataService));
     this.formatLookupDataService    = formatLookupDataService ?? throw new ArgumentNullException(nameof(formatLookupDataService));
     this.genreLookupDataService     = genreLookupDataService ?? throw new ArgumentNullException(nameof(genreLookupDataService));
     this.formatRepository           = formatRepository ?? throw new ArgumentNullException(nameof(formatRepository));
     this.genreRepository            = genreRepository ?? throw new ArgumentNullException(nameof(genreRepository));
 }
Beispiel #7
0
 public PublisherController(IPublisherLookupDataService publisherLookupDataService,
                            IRepository <Publisher> publishersRepository)
 {
     this.publisherLookupDataService = publisherLookupDataService ?? throw new ArgumentNullException(nameof(publisherLookupDataService));
     this.publishersRepository       = publishersRepository ?? throw new ArgumentNullException(nameof(publishersRepository));
 }