public FileSystemMonitorService Create(FileSystemMonitorServiceConfiguration configuration)
        {
            _logger.Log(LogLevel.Trace, "[Start]: File system monitor service creation");
            var fileSystemMonitorService = _fileSystemMonitorServiceFactory.Create(configuration);
            _logger.Log(LogLevel.Trace, "[End]: File system monitor service creation");

            return fileSystemMonitorService;
        }
        public FileSystemMonitorService(
            FileSystemMonitorServiceConfiguration configuration,
            IFolderWatcherFactory folderWatcherFactory,
            FileServiceFactory jobManagerFactory,
            SynchronizationServiceFactory synchronizationServiceFactory,
            ILogger logger)
        {
            _logger = logger;
            _folderWatcherFactory = folderWatcherFactory;
            _folderWatcher = folderWatcherFactory.Create(configuration.FolderToMonitor);
            _jobManagerFactory = jobManagerFactory;
            _synchronizationServiceFactory = synchronizationServiceFactory;
            _configuration = configuration;

            _serviceShutdownEvent = new ManualResetEventSlim(false);
            _fileProcessingRoutine = new Task(this.RunServiceOperation, TaskCreationOptions.LongRunning);
            _operationQueue = new Queue<FileSystemWatcherEventArgs>();

            this.SubscribeToEvents();
            this.InitializeServiceState(configuration);
        }
 private void InitializeServiceState(FileSystemMonitorServiceConfiguration configuration)
 {
     this.CanStop = true;
     this.AutoLog = false;
     this.ServiceName = configuration.ServiceName ?? DefaultServiceName;
 }
 public FileSystemMonitorService Create(FileSystemMonitorServiceConfiguration configuration)
 {
     return _factory.Invoke(configuration);
 }