コード例 #1
0
 public SourceManager(MangaHostSourceManager mangaHpstManager,
                      UnionMangasSourceManager unionManager,
                      YesMangasSourceManager yesManager,
                      MangasProjectSourceManager projectManager,
                      MangaLivreSourceManager mangaLivreManager,
                      HipercoolSourceManager hipercoolManager,
                      HqUltimateSourceManager hqUltimateManager,
                      SiteHelper siteHelper)
 {
     _mangaHostManager  = mangaHpstManager;
     _unionManager      = unionManager;
     _yesManager        = yesManager;
     _projectManager    = projectManager;
     _mangaLivreManager = mangaLivreManager;
     _hipercoolManager  = hipercoolManager;
     _hqUltimateManager = hqUltimateManager;
     _siteHelper        = siteHelper;
     _sources           = new Dictionary <SourcesEnum, IHqSourceManager> {
         [SourcesEnum.MangaHost]     = _mangaHostManager,
         [SourcesEnum.UnionMangas]   = _unionManager,
         [SourcesEnum.YesMangas]     = _yesManager,
         [SourcesEnum.MangasProject] = _projectManager,
         [SourcesEnum.MangaLivre]    = _mangaLivreManager,
         [SourcesEnum.Hipercool]     = _hipercoolManager,
         [SourcesEnum.HqUltimate]    = _hqUltimateManager
     };
 }
コード例 #2
0
        public SourceManager(DependencyInjection dependencyInjection)
        {
            _mangaHostManager = dependencyInjection
                                .DefineDependency <MangaHostSourceManager>(0, "https://mangahost-br.com")
                                .DefineDependency <MangaHostSourceManager>(1, "https://mangahost-br.com/mangas")
                                .Resolve <MangaHostSourceManager>();

            _unionManager = dependencyInjection
                            .DefineDependency <HqSourceManager <UnionMangasSource> >(0, "http://unionmangas.site/")
                            .DefineDependency <HqSourceManager <UnionMangasSource> >(1, "http://unionmangas.site/mangas")
                            .Resolve <HqSourceManager <UnionMangasSource> >();

            _yesManager = dependencyInjection
                          .DefineDependency <HqSourceManager <YesMangasSource> >(0, "https://yesmangasbr.com/")
                          .DefineDependency <HqSourceManager <YesMangasSource> >(1, "https://yesmangasbr.com/mangas")
                          .Resolve <HqSourceManager <YesMangasSource> >();

            _projectManager = dependencyInjection
                              .DefineDependency <MangasProjectSourceManager>(0, "https://leitor.net")
                              .DefineDependency <MangasProjectSourceManager>(1, "https://leitor.net/lista-de-mangas/ordenar-por-nome/todos")
                              .Resolve <MangasProjectSourceManager>();

            _mangaLivreManager = dependencyInjection
                                 .DefineDependency <MangaLivreSourceManager>(0, "https://mangalivre.com/")
                                 .DefineDependency <MangaLivreSourceManager>(1, "https://mangalivre.com/lista-de-mangas/ordenar-por-nome/todos")
                                 .Resolve <MangaLivreSourceManager>();


            _siteHelper = dependencyInjection.Resolve <SiteHelper>();
            _sources    = new Dictionary <SourcesEnum, IHqSourceManager> {
                [SourcesEnum.MangaHost]     = _mangaHostManager,
                [SourcesEnum.UnionMangas]   = _unionManager,
                [SourcesEnum.YesMangas]     = _yesManager,
                [SourcesEnum.MangasProject] = _projectManager,
                [SourcesEnum.MangaLivre]    = _mangaLivreManager,
            };

            _sourceNanagers = new Dictionary <string, IHqSourceManager> {
                ["MangaHost"]     = _mangaHostManager,
                ["UnionMangas"]   = _unionManager,
                ["YesMangas"]     = _yesManager,
                ["MangasProject"] = _projectManager,
                ["MangaLivre"]    = _mangaLivreManager,
            };
        }