/// <inheritdoc /> /// <exception cref="InvalidOperationException"> /// XML configuration doesn't contain element for input manager with specified name. /// </exception> public void BuildInputManager() { XElement inputManagerElement = _documentParser.FindElement(_inputManagerParameterName); if (inputManagerElement is null) { var ex = new InvalidOperationException( $"XML document hasn't value for {_inputManagerParameterName}." ); _logger.Error(ex, "Cannot build InputManager."); throw ex; } String defaultStorageName = XDocumentParser.GetAttributeValue( inputManagerElement, _defaultInStorageNameParameterName ); _inputManager = new IO.Input.InputManager(defaultStorageName); foreach (var element in inputManagerElement.Elements()) { IO.Input.IInputter inputter = _serviceBuilder.CreateInputter(element); _inputManager.Add(inputter); } }
/// <inheritdoc /> public void Reset() { _inputManager = null; _crawlersManager = null; _appraisersManager = null; _outputManager = null; _dataBaseManager = null; }
/// <summary> /// Default constructor which initialize all managers. /// </summary> /// <exception cref="ArgumentNullException"> /// <paramref name="inputManager" /> or <paramref name="crawlersManager" /> or /// <paramref name="appraisersManager" /> or <paramref name="outputManager" /> is /// <c>null</c>. /// </exception> public Shell( IO.Input.InputManager inputManager, Crawlers.CrawlersManager crawlersManager, Appraisers.AppraisersManager appraisersManager, IO.Output.OutputManager outputManager, DAL.DataBaseManager dataBaseManager) { InputManager = inputManager.ThrowIfNull(nameof(inputManager)); CrawlersManager = crawlersManager.ThrowIfNull(nameof(crawlersManager)); AppraisersManager = appraisersManager.ThrowIfNull(nameof(appraisersManager)); OutputManager = outputManager.ThrowIfNull(nameof(outputManager)); DataBaseManager = dataBaseManager.ThrowIfNull(nameof(dataBaseManager)); }