/// <summary> /// Server constructor. /// </summary> /// <param name="logger">ILogging interface implementation</param> /// <param name="controller">ILogging interface implementation</param> /// <returns> /// </returns> /// <remarks> /// </remarks> private void CreateHandler(string directory) { IHandler h = new DirectoryHandler(controller, logger); h.StartHandleDirectory(directory); CommandReceived += h.OnCommandReceived; h.DirectoryClose += NotifyClientsDirectoryClosed; }
/// <summary> /// Creating handlers and adding them to the event listener /// </summary> /// <param name="directory"> the handler directory</param> public void CreateHandler(string directory) { IDirectoryHandler handler = new DirectoryHandler(this.imageController, this.logger); handler.StartHandleDirectory(directory); onCommand += handler.OnCommandRecieved; informHandlerClose += handler.CloseHandler; handler.DirectoryClose += OnCloseServer; }