Ejemplo n.º 1
0
        public InfoApiWebSocketService(IWebSocketHandler webSocketHandler, IAnimeProfileHandler infoApiHandler, INiblHandler niblHandler, IDebugHandler debugHandler)
        {
            debugHandler.TraceMessage("Constructor Called.", DebugSource.CONSTRUCTOR, DebugType.ENTRY_EXIT);

            WebSocketHandler    = webSocketHandler;
            AnimeProfileHandler = infoApiHandler;
            NiblHandler         = niblHandler;
            DebugHandler        = debugHandler;

            WeebFileNameParser = new WeebFileNameParser();
        }
Ejemplo n.º 2
0
        public StartUp()
        {
            //handlers

            DebugHandler    = new DebugHandler();
            SettingsHandler = new SettingsHandler(DebugHandler);

            DebugHandler.SetSettings(SettingsHandler);

            DirectoryHandler    = new DirectoryHandler(DebugHandler);
            FileHistoryHandler  = new FileHistoryHandler(DebugHandler);
            FileHandler         = new FileHandler(DebugHandler);
            VersionHandler      = new VersionHandler(DebugHandler);
            WebSocketHandler    = new WebSocketHandler(SettingsHandler, DebugHandler);
            IrcClientHandler    = new IrcClientHandler(SettingsHandler, DebugHandler);
            DownloadHandler     = new DownloadHandler(IrcClientHandler, DebugHandler);
            KitsuHandler        = new KitsuHandler(DebugHandler);
            NiblHandler         = new NiblHandler(KitsuHandler, DebugHandler);
            AnimeProfileHandler = new AnimeProfileHandler(KitsuHandler, NiblHandler, DebugHandler);

            //Services
            DirectoryWebSocketService = new DirectoryWebSocketService(WebSocketHandler, DirectoryHandler, DebugHandler);
            DownloadWebSocketService  = new DownloadWebSocketService(WebSocketHandler, DirectoryHandler, DownloadHandler, FileHandler, FileHistoryHandler, SettingsHandler, DebugHandler);
            FileWebSocketService      = new FileWebSocketService(WebSocketHandler, FileHandler, FileHistoryHandler, DownloadHandler, DebugHandler);
            IrcWebSocketService       = new IrcWebSocketService(WebSocketHandler, IrcClientHandler, SettingsHandler, DebugHandler);
            SettingsWebSocketService  = new SettingsWebSocketService(WebSocketHandler, DirectoryHandler, DebugHandler);
            InfoApiWebSocketService   = new InfoApiWebSocketService(WebSocketHandler, AnimeProfileHandler, NiblHandler, DebugHandler);
            VersionWebSocketService   = new VersionWebSocketService(WebSocketHandler, VersionHandler, DebugHandler);


            //Sub Controllers
            DirectoryWebSocketController = new DirectoryWebSocketController(WebSocketHandler, DirectoryWebSocketService, DebugHandler);
            DownloadWebSocketController  = new DownloadWebSocketController(WebSocketHandler, DownloadWebSocketService, DirectoryWebSocketService, DebugHandler);
            FileWebSocketController      = new FileWebSocketController(WebSocketHandler, FileWebSocketService, DebugHandler);
            IrcWebSocketController       = new IrcWebSocketController(WebSocketHandler, IrcWebSocketService, DebugHandler);
            SettingsWebSocketController  = new SettingsWebSocketController(WebSocketHandler, SettingsWebSocketService, DebugHandler);
            InfoApiWebSocketController   = new InfoApiWebSocketController(WebSocketHandler, InfoApiWebSocketService, DebugHandler);
            VersionWebSocketController   = new VersionWebSocketController(WebSocketHandler, VersionWebSocketService, DebugHandler);

            IBaseWebSocketController baseWebSocketController = new BaseWebSocketController(WebSocketHandler, DebugHandler);

            //start debugh handler registering all the handlers, services and controllers as IDebugEvent interface.

            SettingsWebSocketService.SetSettingsClasses(
                SettingsHandler,
                IrcClientHandler,
                FileHandler,
                DownloadHandler,
                DirectoryWebSocketService,
                IrcWebSocketService
                );

            baseWebSocketController.SetSubControllers(new List <ISubWebSocketController>()
            {
                DirectoryWebSocketController,
                DownloadWebSocketController,
                FileWebSocketController,
                IrcWebSocketController,
                SettingsWebSocketController,
                InfoApiWebSocketController,
                VersionWebSocketController
            });
        }