public AuthorController(IAuthorLookupDataService authorLookupDataService,
                         IRepository <Author> authorsRepository,
                         INationalityLookupDataService nationalityLookupDataService)
 {
     this.authorLookupDataService      = authorLookupDataService ?? throw new ArgumentNullException(nameof(authorLookupDataService));
     this.authorsRepository            = authorsRepository ?? throw new ArgumentNullException(nameof(authorsRepository));
     this.nationalityLookupDataService = nationalityLookupDataService ?? throw new ArgumentNullException(nameof(nationalityLookupDataService));
 }
        public AuthorsViewModel(IEventAggregator eventAggregator,
                                IAuthorLookupDataService authorLookupDataService)
            : base(eventAggregator)
        {
            this.authorLookupDataService = authorLookupDataService
                                           ?? throw new ArgumentNullException(nameof(authorLookupDataService));

            Init();
        }
示例#3
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();
        }
示例#4
0
        public AuthorsViewModel(IEventAggregator eventAggregator,
                                IAuthorLookupDataService authorLookupDataService,
                                ILogger logger,
                                IDialogService dialogService)
            : base(eventAggregator, logger, dialogService)
        {
            this.authorLookupDataService = authorLookupDataService
                                           ?? throw new ArgumentNullException(nameof(authorLookupDataService));

            Init();

            ViewModelType = nameof(AuthorDetailViewModel);
        }
        public AuthorsViewModel(IEventAggregator eventAggregator,
                                IAuthorLookupDataService authorLookupDataService,
                                ILogger logger,
                                IDialogService dialogService)
            : base(eventAggregator, logger, dialogService)
        {
            _authorLookupDataService = authorLookupDataService
                                       ?? throw new ArgumentNullException(nameof(authorLookupDataService));

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

            Init().Await();

            ViewModelType = nameof(AuthorDetailViewModel);
        }
示例#6
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));
 }