Пример #1
0
        public WriterJob(IWriter writer, INextCheck nextCheck, IWriterQueue queue)
        {
            _writer    = writer ?? throw new ArgumentNullException(nameof(writer));
            _nextCheck = nextCheck ?? throw new ArgumentNullException(nameof(nextCheck));
            _queue     = queue ?? throw new ArgumentNullException(nameof(queue));

            _queue.AddEvent += WaitHandlerSet;
        }
        public IJob Create(IWriterQueue queue, INextCheck nextCheck, CompressionMode mode)
        {
            switch (mode)
            {
            case CompressionMode.Compress:
            case CompressionMode.Decompress:
                return(new WriterJob(new FileWriter(_filePath), nextCheck, queue));

            default:
                throw new ArgumentOutOfRangeException(nameof(mode), mode, "This mod is not supported.");
            }
        }