Пример #1
0
        public TaggerController(
            ICommandInfoProvider commandInfoProvider,
            IDocumentsDataService service,
            IDocumentFactory documentFactory,
            IDocumentPostReadNormalizer documentReadNormalizer,
            IDocumentPreWriteNormalizer documentWriteNormalizer,
            Func <Type, ITaggerCommand> commandFactory,
            IFactory <ICommandSettings> commandSettingsFactory)
        {
            if (commandInfoProvider == null)
            {
                throw new ArgumentNullException(nameof(commandInfoProvider));
            }

            this.service                 = service ?? throw new ArgumentNullException(nameof(service));
            this.documentFactory         = documentFactory ?? throw new ArgumentNullException(nameof(documentFactory));
            this.documentReadNormalizer  = documentReadNormalizer ?? throw new ArgumentNullException(nameof(documentReadNormalizer));
            this.documentWriteNormalizer = documentWriteNormalizer ?? throw new ArgumentNullException(nameof(documentWriteNormalizer));
            this.commandFactory          = commandFactory ?? throw new ArgumentNullException(nameof(commandFactory));
            this.commandSettingsFactory  = commandSettingsFactory ?? throw new ArgumentNullException(nameof(commandSettingsFactory));

            commandInfoProvider.ProcessInformation();

            var commandsInformation = commandInfoProvider.CommandsInformation
                                      .Where(p => p.Key.GetInterfaces()
                                             .Contains(typeof(ISimpleTaggerCommand)));

            this.commandsInformation = new Dictionary <Type, ICommandInfo>();
            foreach (var commandInformation in commandsInformation)
            {
                this.commandsInformation.Add(commandInformation.Key, commandInformation.Value);
            }
        }
Пример #2
0
 public ReadDocumentHelper(
     IDocumentFactory documentFactory,
     IDocumentMerger documentMerger,
     IDocumentReader documentReader,
     IDocumentPostReadNormalizer documentNormalizer)
 {
     this.documentFactory    = documentFactory ?? throw new ArgumentNullException(nameof(documentFactory));
     this.documentMerger     = documentMerger ?? throw new ArgumentNullException(nameof(documentMerger));
     this.documentReader     = documentReader ?? throw new ArgumentNullException(nameof(documentReader));
     this.documentNormalizer = documentNormalizer ?? throw new ArgumentNullException(nameof(documentNormalizer));
 }