public MainPageViewModel(IMessageService messageService, IBooksService booksService) { _messageService = messageService; _booksService = booksService; AddBookCommand = new DelegateCommand(OnAddBook); InitBooks(); }
public BooksViewModel(IBooksService booksService, IMessagingService messagingService) { _booksService = booksService; _messagingService = messagingService; NewBookCommand = new DelegateCommand(OnNewBook); EventAggregator<InitBookEvent>.Instance.Event += OnInitBook; }
public BookViewModel(IBooksService booksService) { _booksService = booksService; SaveBookCommand = new DelegateCommand(OnSaveBook); EventAggregator<BookInfoEvent>.Instance.Event += LoadBook; }
public BookViewModel(IBooksService booksService) { _booksService = booksService; EventAggregator<SelectedBookEvent>.Instance.Event += SelectedBookChanged; Book = _booksService.GetBooks().Skip(1).First(); EventAggregator<InitBookEvent>.Instance.Publish(this, new InitBookEvent() { Isbn = Book.Isbn }); }
protected void RefreshServicesAndClearCache() { DatabaseContext = m_Host.Services.GetService <IDatabaseContext>(); DatabaseContext.RefreshDatabaseContext(); BooksService = m_Host.Services.GetService <IBooksService>(); WordsService = m_Host.Services.GetService <IWordsService>(); MasterWordsService = m_Host.Services.GetService <IMasterWordsService>(); LanguagesService = m_Host.Services.GetService <ILanguagesService>(); AccountService = m_Host.Services.GetService <IAccountService>(); }
public BooksController(IUserService userService , IBooksService booksServices , IMapper mapper , ILogger logger , UserAuthentication userAuthentication) { _userService = userService; _booksServices = booksServices; _mapper = mapper; _logger = logger; _userAuthentication = userAuthentication; }
public BooksController(IBooksService booksService, IAuthorsService authorsService, ICacheService cacheService, IMapper mapper) { Guard.WhenArgument(booksService, nameof(booksService)).IsNull().Throw(); Guard.WhenArgument(authorsService, nameof(authorsService)).IsNull().Throw(); Guard.WhenArgument(cacheService, nameof(cacheService)).IsNull().Throw(); Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw(); this.booksService = booksService; this.authorsService = authorsService; this.cacheService = cacheService; this.mapper = mapper; }
// Dependency Injection public BooksListViewModel(IBooksService booksService, IEventAggregator eventAggregator, IMessageService messageService) { _booksService = booksService; _eventAggregator = eventAggregator; _messageService = messageService; RefreshBooks(); _eventAggregator.GetEvent <RefreshBooksEvent>().Subscribe(RefreshBooks); ShowMessageCommand = new DelegateCommand(OnShowMessage); }
public BookViewModel(IBooksService booksService) { _booksService = booksService; _booksService.PropertyChanged += (sender, e) => { if (e.PropertyName == "CurrentBook") { base.RaisePropertyChanged(nameof(CurrentBook)); } }; }
public ComicsViewModel(IArtistsService artistsService, IBooksService booksService, ICharactersService charactersService, ICodesService codesService, IPublishersService publishersService, ISeriesService seriesService, IStoriesService storiesService, IExportBooksService exportBooksService, IMapper mapper, NavigationService navigationService, IConfiguration configuration) : base(mapper) { _navigationService = navigationService; _configuration = configuration; ArtistView = new ArtistViewModel(artistsService, mapper); BookView = new BookViewModel(booksService, mapper); CharacterView = new CharacterViewModel(charactersService, mapper); CodeView = new CodeViewModel(codesService, mapper); PublisherView = new PublisherViewModel(publishersService, mapper); SeriesView = new SeriesViewModel(seriesService, mapper); StoryView = new StoryViewModel(storiesService, mapper); ReportView = new ReportViewModel(exportBooksService, mapper); Languages = LanguageType.FillLanguages(); Actives = FillEnum <Active>(); FirstPrints = FillEnum <FirstPrint>(); BookTypes = FillEnum <BookType>(); StoryTypes = FillEnum <StoryType>(); ShowArtistFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowArtistFromStoryWindow)); ShowBookFromPublisherWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromPublisherWindow)); ShowBookFromSeriesWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromSeriesWindow)); ShowBookFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowBookFromStoryWindow)); ShowCharacterFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCharacterFromStoryWindow)); ShowCodeFromSeriesWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCodeFromSeriesWindow)); ShowCodeFromStoryWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowCodeFromStoryWindow)); ShowPublisherFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowPublisherFromBookWindow)); ShowSeriesFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowSeriesFromBookWindow)); ShowSeriesFromCodeWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowSeriesFromCodeWindow)); ShowStoryFromArtistWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromArtistWindow)); ShowStoryFromBookWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromBookWindow)); ShowStoryFromCharacterWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromCharacterWindow)); ShowStoryFromCodeWindowCommand = new RelayCommand <int?>(new Action <int?>(ShowStoryFromCodeWindow)); ShowArtistWindowCommand = new RelayCommand(new Action(ShowArtistWindow)); ShowBookWindowCommand = new RelayCommand(new Action(ShowBookWindow)); ShowCharacterWindowCommand = new RelayCommand(new Action(ShowCharacterWindow)); ShowCodeWindowCommand = new RelayCommand(new Action(ShowCodeWindow)); ShowPublisherWindowCommand = new RelayCommand(new Action(ShowPublisherWindow)); ShowSeriesWindowCommand = new RelayCommand(new Action(ShowSeriesWindow)); ShowStoryWindowCommand = new RelayCommand(new Action(ShowStoriesWindow)); ShowReportWindowCommand = new RelayCommand(new Action(ShowReportWindow)); }
public BooksViewModel(IBooksService booksService, IEventAggregator eventAggregator, IShowMessageService messageService) { _booksService = booksService ?? throw new ArgumentNullException(nameof(booksService)); _eventAggregator = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator)); _messageService = messageService ?? throw new ArgumentNullException(nameof(messageService)); RefreshCommand = new DelegateCommand(LoadBooks); AddBookCommand = new DelegateCommand(AddBook, CanAddBook); ShowMessageCommand = new DelegateCommand(ShowMessage); }
public void Dispose() { if (m_Service != null) { logout(); m_Service = null; m_Service2.close(); m_Service2 = null; m_Factory.Close(); m_Factory2.Close(); } }
/// <summary> /// Initializes a new instance of the <see cref="BookSummaryViewModel"/> class. /// </summary> /// <param name="book">The book.</param> /// <param name="booksService">The books service.</param> /// <param name="shoppingCartService">The shopping cart service.</param> /// <param name="authService">The authentication service.</param> /// <exception cref="ArgumentNullException"></exception> public BookSummaryViewModel(DetailedBookDto book, IBooksService booksService, IShoppingCartService shoppingCartService, IAuthenticationService authService) { if (book == null) { throw new ArgumentNullException(nameof(book)); } this.Book = book; this.booksService = booksService; this.shoppingCartService = shoppingCartService; this.authService = authService; this.booksService.MyBooks.CollectionChanged += this.MyBooks_CollectionChanged; }
public MainPageViewModel( IBooksService booksService, IDialogService dialogService, ILogger <MainPageViewModel> logger) { _booksService = booksService; _dialogService = dialogService; _logger = logger; AddBookCommand = new DelegateCommand(AddBook); GetBookCommand = new DelegateCommand(OnGetBook); RefreshBooksCommand = new DelegateCommand(RefreshBooks); }
public SearchController( ISearchService searchService, ITechnologiesService technologiesService, IBooksService booksService, IAuthorsService authorsService, IGlobalSearchService globalSearchService) { _searchService = searchService; _technologiesService = technologiesService; _booksService = booksService; _authorsService = authorsService; _globalSearchService = globalSearchService; }
public SearchBookPageViewModel(IPageDialogService pageDialogService, INavigationService navigationService, IBooksService BookService) : base(pageDialogService, navigationService) { _BookService = BookService; var connectionService = Xamarin.Forms.DependencyService.Get <ISQLite>(); if (connectionService != null) { _BookRepo = new Repository <eBooksDT.Models.Book>(connectionService); } AddListCommand = new DelegateCommand <Books>(async(Books arg) => await AddToList(arg)); }
/// <inheritdoc /> public ParserService( IPiterParser piterParser, IAuthorsService authorsService, IPublishingsService publishingsService, ITechnologiesService technologiesService, IBooksService booksService, IEksmoParser eksmoParser) { _piterParser = piterParser; _authorsService = authorsService; _publishingsService = publishingsService; _technologiesService = technologiesService; _booksService = booksService; _eksmoParser = eksmoParser; }
public DiscussionsController(IDiscussionsService discussionsService, IUsersService usersService, IBooksService booksService, IDiscussionUsersData discussionUsersData, IMapper mapper) { Guard.WhenArgument(discussionsService, nameof(discussionsService)).IsNull().Throw(); Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw(); Guard.WhenArgument(booksService, nameof(booksService)).IsNull().Throw(); Guard.WhenArgument(discussionUsersData, nameof(discussionUsersData)).IsNull().Throw(); Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw(); this.discussionsService = discussionsService; this.usersService = usersService; this.booksService = booksService; this.discussionUsersData = discussionUsersData; this.mapper = mapper; }
public HomeController(IUsersService usersService, IDiscussionsService discussionsService, IBooksService booksService, ICommentsService commentsService, IAuthorsService authorService, ApplicationUserManager userManager) { Guard.WhenArgument(usersService, nameof(usersService)).IsNull().Throw(); Guard.WhenArgument(discussionsService, nameof(discussionsService)).IsNull().Throw(); Guard.WhenArgument(booksService, nameof(booksService)).IsNull().Throw(); Guard.WhenArgument(commentsService, nameof(commentsService)).IsNull().Throw(); Guard.WhenArgument(authorService, nameof(authorService)).IsNull().Throw(); Guard.WhenArgument(userManager, nameof(userManager)).IsNull().Throw(); this.usersService = usersService; this.discussionsService = discussionsService; this.booksService = booksService; this.commentsService = commentsService; this.authorService = authorService; this.userManager = userManager; }
public MainViewModel(IBooksService bs) { booksService = bs; CurrentPage = Pages.Books; // CurrentPage = Add_book; ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} }
static void Main(string[] args) { Console.WriteLine(Resource.Apptitle); container = WindsorCastleContainer.Instance; ConfigureIoC.Configure(container); libraryService = container.Resolve <IBooksService>(); while (true) { AskForValue(Resource.SelectOperation); OperationDispatcher(inputValue); AskToContinue(); } }
static void Main(string[] args) { Console.WriteLine(Resource.Apptitle); container = WindsorCastleContainer.Instance; ConfigureIoC.Configure(container); libraryService = container.Resolve<IBooksService>(); while (true) { AskForValue(Resource.SelectOperation); OperationDispatcher(inputValue); AskToContinue(); } }
public void connect() { EndpointAddress address = new EndpointAddress(new Uri(ConfigurationManager.AppSettings["service"])); //BasicHttpBinding binding = new BasicHttpBinding(); WSDualHttpBinding binding = new WSDualHttpBinding(); //m_Factory = new ChannelFactory<IBooksService>(binding, address); m_Factory = new ChannelFactory <IBooksService>(binding, address); m_Service = m_Factory.CreateChannel(); InstanceContext context = new InstanceContext(this); m_Factory2 = new DuplexChannelFactory <ICallbackService>(context, new WSDualHttpBinding(), new EndpointAddress(new Uri(ConfigurationManager.AppSettings["service2"]))); m_Service2 = m_Factory2.CreateChannel(); m_Service2.dispatch(); }
public SearchService( DatabaseContext context, IMapper mapper, IAuthorsService authorsService, IBooksService booksService, IPublishingsService publishingsService, ITechnologiesService technologiesService) { _context = context; _mapper = mapper; _authorsService = authorsService; _booksService = booksService; _publishingsService = publishingsService; _technologiesService = technologiesService; }
public BooksViewModel(IBooksService booksService, ISelectedBookService selectedBookService, IDialogService dialogService, IEventAggregator eventAggregator, IOpenWindow openWindow) { _booksService = booksService; _selectedBookService = selectedBookService; _dialogService = dialogService; _eventAggregator = eventAggregator; _openWindow = openWindow; _selectedBookService.PropertyChanged += (sender, e) => { base.OnPropertyChanged(nameof(CurrentBook)); }; RefreshBooksCommand = new DelegateCommand(OnGetBooks); NewWindowCommand = new DelegateCommand(OnNewWindow); }
public MainViewModel(IMessageService messageService, IBooksService booksService) { if (messageService == null) { throw new ArgumentNullException(nameof(messageService)); } if (booksService == null) { throw new ArgumentNullException(nameof(booksService)); } _messageService = messageService; _booksService = booksService; Task t1 = RefreshBooksAsync(); ActionCommand = new DelegateCommand(Action); }
public BooksMasterDetailViewModel(ILoggerFactory loggerFactory, IBooksService booksService, IEventAggregator eventAggregator, IDialogService dialogService) : base(loggerFactory) { _booksService = booksService; _eventAggregator = eventAggregator; _dialogService = dialogService; _eventAggregator.GetEvent <RefreshBooksEvent>().Subscribe(() => { OnRefresh(); }); InitBooks(); TestCommand = new RelayCommand(async() => { await _dialogService.ShowMessageAsync("Hello from the View-Model"); }); }
public AddBookController( IBooksService booksService, IGenresService genresService, IUserProvider userProvider, IServerProvider serverProvider, ICacheProvider cacheProvider, IMapperAdapter mapper) { if (booksService == null) { throw new ArgumentNullException("booksService"); } if (genresService == null) { throw new ArgumentNullException("genresService"); } if (userProvider == null) { throw new ArgumentNullException("userProvider"); } if (serverProvider == null) { throw new ArgumentNullException("serverProvider"); } if (cacheProvider == null) { throw new ArgumentNullException("cacheProvider"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } this.booksService = booksService; this.genresService = genresService; this.userProvider = userProvider; this.serverProvider = serverProvider; this.cacheProvider = cacheProvider; this.mapper = mapper; }
public BookDetailPageViewModel(IPageDialogService pageDialogService, INavigationService navigationService, IBooksService BookService) : base(pageDialogService, navigationService) { try { _BookService = BookService; var connectionService = Xamarin.Forms.DependencyService.Get <ISQLite>(); _BookRepo = new Repository <eBooksDT.Models.Book>(connectionService); AddListCommand = new DelegateCommand(async() => await AddToList()); } catch (Exception ex) { ErrorLog.LogError("ERROR: Loading Book detail", ex); } }
public BooksController( IBooksService booksService, IGenresService genresService, ITagsService tagsService, IAwardsService awardsService, IAuthorsService authorsService, IEditionLanguagesService languagesService, IBookTagsService bookTagsService, ICloudinaryService cloudinaryService) { this.booksService = booksService; this.genresService = genresService; this.tagsService = tagsService; this.awardsService = awardsService; this.authorsService = authorsService; this.languagesService = languagesService; this.bookTagsService = bookTagsService; this.cloudinaryService = cloudinaryService; }
public SearchController(IBooksService booksService, IGenresService genresService, IMapperAdapter mapper) { if (booksService == null) { throw new ArgumentNullException("booksService"); } if (genresService == null) { throw new ArgumentNullException("genresService"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } this.booksService = booksService; this.genresService = genresService; this.mapper = mapper; }
public Program( ILogger logger, IMenu menu, IIoHelper ioHelper, IBooksService booksService, IAuthorsService authorsService, IUsersService usersService, INotificationsService notificationService, IDatabaseManagementService databaseManagementService, IBookStoreService bookStoreService) { _logger = logger; _menu = menu; _ioHelper = ioHelper; _booksService = booksService; _authorsService = authorsService; _usersService = usersService; _notificationService = notificationService; _databaseManagementService = databaseManagementService; _bookStoreService = bookStoreService; }
public BookViewModel(IBooksService booksService, ISelectedBookService selectedBookService, IDialogService dialogService, IEventAggregator eventAggregator) { _booksService = booksService; _selectedBookService = selectedBookService; _dialogService = dialogService; _eventAggregator = eventAggregator; AddBookCommand = new DelegateCommand(OnAddBook, CanAddBook); EditBookCommand = new DelegateCommand(OnEditBook, CanEditBook); SaveBookCommand = new DelegateCommand(OnSaveBook, CanSaveBook); CancelBookCommand = new DelegateCommand(OnCancel, CanCancel); CurrentEditMode = BookEditMode.Read; UpdateCommandState(); _selectedBookService.PropertyChanged += (sender, e) => { if (e.PropertyName == "Book") { OnPropertyChanged("Book"); // fire property change on view-model Book if referenced Book fires change } }; }
public DetailsViewModel(IBooksService books) { _books = books; }
public HomeController(IBooksService books) { this.books = books; }
public frmBooksStore() { InitializeComponent(); this._bookService = new BooksServiceMock(); }
public TemplatingController(IBooksService booksService) { _booksService = booksService; }
// let IoC inject a BooksService for me public BooksViewModel(IBooksService booksService) { _booksService = booksService; }
public BooksViewModel(IBooksService booksService) { _booksService = booksService; GetBooksCommand = new DelegateCommand(OnGetBooks, CanGetBooks); AddBookCommand = new DelegateCommand(OnAddBook); }
public BooksController(IBooksService booksService) { _booksService = booksService; }
public BooksController(IBooksService books, IBookCommentsService comments) { this.books = books; this.comments = comments; }
public BookListInfoPageViewModel(IPageDialogService pageDialogService, INavigationService navigationService, IBooksService BookService) : base(pageDialogService, navigationService) { var connectionService = Xamarin.Forms.DependencyService.Get <ISQLite>(); _BookRepo = new Repository <Book>(connectionService); }
public FirstViewModel(IBooksService books) { _books = books; }
public BooksViewComponent(IBooksService booksService) =>
public ChartingController(IBooksService booksService) { _booksService = booksService; }