示例#1
0
 public void Setup()
 {
     _comics          = new TestData().Comics();
     _comicRepository = MockRepository.MockComicRepository(_comics);
     _unitOfWork      = new Mock <IUnitOfWork>().Object;
     _comicService    = new ComicService(_comicRepository, _unitOfWork);
 }
示例#2
0
 public IndexModel(IComicService comicService, IGalleryService galleryService,
                   IOptions <ApplicationSettings> options)
 {
     _comicService   = comicService;
     _galleryService = galleryService;
     _appOptions     = options;
 }
示例#3
0
 public ReadController(IComicService comicService, IGalleryService galleryService,
                       IOptions <ApplicationSettings> options)
 {
     _comicService   = comicService;
     _galleryService = galleryService;
     _appOptions     = options;
 }
示例#4
0
        public AdminController(IComicService comicService, IOrderService orderService)
        {
            Guard.WhenArgument(comicService, "comicService").IsNull().Throw();
            Guard.WhenArgument(orderService, "orderService").IsNull().Throw();

            this.comicService = comicService;
            this.orderService = orderService;
        }
示例#5
0
        public ComicViewModel(IComicService comicService)
        {
            this.comicService = comicService;

            FirstComicCommand    = new Command(OnFirstComic);
            NextComicCommand     = new Command(OnNextComic);
            PreviousComicCommand = new Command(OnPreviousComic);
            LastComicCommand     = new Command(OnLastComic);
            RandomComicCommand   = new Command(OnRandomComic);
        }
示例#6
0
 public ScanService(
     IOptions <ApplicationSettings> options,
     IHubContext <ScanHub> hubContext,
     IGalleryService galleryService,
     IComicService comicService
     )
 {
     _options        = options;
     _hubContext     = hubContext;
     _galleryService = galleryService;
     _comicService   = comicService;
 }
示例#7
0
		public AddComicViewModel(IInteractionService message, IComicService comicManager)
		{
			Interaction = message;
			ComicManager = comicManager;

			DownloadCommand = new AsyncRelayCommand(Download, (o) => !Downloading && ComicValid(ComicNumber));

			PropertyChanged += (o, e) =>
			{
				if (e.PropertyName == "Downloading" || e.PropertyName == "ComicNumber")
					DownloadCommand.RaiseCanExecuteChanged();
			};
		}
示例#8
0
		public MainWindowViewModel(IInteractionService message, IComicService comicManager, IPropertiesService properties)
		{
			Interaction = message;
			ComicManager = comicManager;
			Properties = properties;

			AddComicCommand = new RelayCommand(AddComic, (o) => !Downloading);
			AddRandomComicCommand = new AsyncRelayCommand(AddRandomComic);
			AddCurrentComicCommand = new AsyncRelayCommand(AddCurrentComic, (o) => !Downloading);
			RemoveComicCommand = new RelayCommand(RemoveComic, () => SelectedComic != null);
			ClearComicsCommand = new RelayCommand(() => Comics.Clear());

			LoadedCommand = new AsyncRelayCommand(Loaded);
			ClosedCommand = new AsyncRelayCommand(Closed);

			AboutCommand = new RelayCommand(About);
			ConfigurationCommand = new RelayCommand(Configuration);

			CopyLinkCommand = new RelayCommand(
				(o) => Interaction.SetClipboardText(string.Format(o as string, SelectedComic.Number)),
				(o) => SelectedComic != null && o is string);

			DeleteCacheCommand = new RelayCommand(
				() => SelectedComic?.DeleteCache(),
				() => SelectedComic != null);

			OpenLinkCommand = new RelayCommand(
				(o) => Interaction.StartProcess(string.Format(o as string, SelectedComic.Number)),
				(o) => SelectedComic != null && o is string);

			PropertyChanged += (o, e) =>
			{
				if (e.PropertyName == "SelectedComic")
				{
					RemoveComicCommand.RaiseCanExecuteChanged();
					DeleteCacheCommand.RaiseCanExecuteChanged();
					OpenLinkCommand.RaiseCanExecuteChanged();
					CopyLinkCommand.RaiseCanExecuteChanged();
				}

				if (e.PropertyName == "Downloading")
				{
					AddComicCommand.RaiseCanExecuteChanged();
					AddCurrentComicCommand.RaiseCanExecuteChanged();
					AddRandomComicCommand.RaiseCanExecuteChanged();
				}
			};
		}
		public ConfigurationViewModel(IInteractionService message, IComicService comicManager, IPropertiesService properties)
		{
			Interaction = message;
			ComicManager = comicManager;
			Properties = properties;

			LoadFromProperties();

			OkCommand = new RelayCommand(Ok, (o) => !Busy);
			CancelCommand = new RelayCommand(Cancel, (o) => !Busy);
			ResetCommand = new RelayCommand(Reset);
			ClearCacheCommand = new AsyncRelayCommand(ClearCache, (o) => !Busy);

			PropertyChanged += (o, e) =>
			{
				if (e.PropertyName == "Busy")
				{
					OkCommand.RaiseCanExecuteChanged();
					CancelCommand.RaiseCanExecuteChanged();
					ClearCacheCommand.RaiseCanExecuteChanged();
				}
			};
		}
 public HomeController(ILogger <HomeController> logger, IComicService comicService)
 {
     _logger       = logger;
     _comicService = comicService;
 }
 public UserComicController(IUserComicService userComicService, IComicService comicService, IUserSeriesService userSeries)
 {
     _userComicService = userComicService;
     _comicService     = comicService;
     _userSeries       = userSeries;
 }
示例#12
0
 public ComicController(IComicService service) : base(service)
 {
     _service = service;
 }
示例#13
0
 public ComicModel(IComicService comicService, IGalleryService galleryService)
 {
     _comicService   = comicService;
     _galleryService = galleryService;
 }
示例#14
0
 public ComicController(ILogger <ComicController> logger, IMemoryCache cache, IComicService comicService)
 {
     _logger       = logger;
     _cache        = cache;
     _comicService = comicService;
 }
示例#15
0
 public ComicController(IComicService comicService)
 {
     _comicService = comicService;
 }
示例#16
0
        public ShoppingCartController(IComicService comicService)
        {
            Guard.WhenArgument(comicService, "comicService").IsNull().Throw();

            this.comicService = comicService;
        }
 public ContactRepository(ISessionWrapper session, IComicService comicService)
 {
     _session = session;
     _comicService = comicService;
 }
 public ContactRepository(ISessionWrapper session, IComicService comicService)
 {
     _session      = session;
     _comicService = comicService;
 }
示例#19
0
        private void InjectionInitialize(
            ICharacterService characterService,
            IComicService comicService,
            ICreatorService creatorService,
            ISeriesService seriesService,
            IEventService eventService,
            ILoadingManager loadingManager,
            IScreenManager screenManager,
            IEventManager eventManager,
            IResultProcessor resultProcessor,
            IPlanetSystemSpawner planetSystemSpawner,
            SearchViewModel searchViewModel)
        {
            this.characterService = characterService;
            this.comicService = comicService;
            this.creatorService = creatorService;
            this.seriesService = seriesService;
            this.eventService = eventService;

            this.loadingManager = loadingManager;
            this.screenManager = screenManager;
            this.eventManager = eventManager;
            this.resultProcessor = resultProcessor;
            this.planetSystemSpawner = planetSystemSpawner;

            this.searchViewModel = searchViewModel;

            this.eventManager.GetEvent<LoadingEvent>().AddListener(this.OnLoading);
        }
示例#20
0
 private void InjectionInitialize(
     IComicService comicService)
 {
     this.comicService = comicService;
 }
 public ComicsController(BookContext context, IComicService service)
 {
     _context = context;
     _service = service;
 }
 public ComicController(IComicService comicService, IUserComicService userComicService)
 {
     _comicService     = comicService;
     _userComicService = userComicService;
 }