예제 #1
0
 public IrcWebSocketController(IWebSocketHandler webSocketHandler, IIrcWebSocketService ircWebSocketService, IDebugHandler debugHandler)
 {
     debugHandler.TraceMessage("Constructor Called.", DebugSource.CONSTRUCTOR, DebugType.ENTRY_EXIT);
     DebugHandler        = debugHandler;
     IrcWebSocketService = ircWebSocketService;
     WebSocketHandler    = webSocketHandler;
 }
        public Task SetSettingsClasses(
            ISettingsHandler settingsHandler,
            IIrcClientHandler ircClientHandler,
            IFileHandler fileHandler,
            IDownloadHandler downloadHandler,
            IDirectoryWebSocketService directoryWebSocketService,
            IIrcWebSocketService ircWebSocketService
            )
        {
            DebugHandler.TraceMessage("SetSettingsClasses Called.", DebugSource.TASK, DebugType.ENTRY_EXIT);

            SettingsHandler           = settingsHandler;
            IrcClientHandler          = ircClientHandler;
            DownloadHandler           = downloadHandler;
            DirectoryWebSocketService = directoryWebSocketService;
            IrcWebSocketService       = ircWebSocketService;


            WebSocketHandlerSettings          = WebSocketHandler as ISettingsInterface;
            IrcClientHandlerSettings          = ircClientHandler as ISettingsInterface;
            DebugHandlerSettings              = DebugHandler as ISettingsInterface;
            FileHandlerSettings               = fileHandler as ISettingsInterface;
            DownloadHandlerSettings           = downloadHandler as ISettingsInterface;
            DirectoryWebSocketServiceSettings = directoryWebSocketService as ISettingsInterface;
            IrcWebSocketServiceSettings       = ircWebSocketService as ISettingsInterface;

            LittleWeebSettings = settingsHandler.GetLittleWeebSettings();
            IrcSettings        = settingsHandler.GetIrcSettings();

            SetAllIrcSettings(IrcSettings);
            SetAllLittleWeebSettings(LittleWeebSettings);

            return(Task.CompletedTask);
        }
예제 #3
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
            });
        }