private static ExpectedParameter[] GetExpectedParameters(JsonCompositeCommandConfiguration commandConfiguration) { return(commandConfiguration .InputParameters ?.Select(parameter => parameter.ToExpectedParameter()) ?.ToArray()); }
internal CompositeCommand Build(JsonCompositeCommandConfiguration commandConfiguration) { if (commandConfiguration == null) { throw new System.ArgumentNullException(nameof(commandConfiguration)); } commandConfiguration.Validate(); var command = new CompositeCommand(commandConfiguration.CommandName, GetExpectedParameters(commandConfiguration), commandConfiguration.ExpectedInputFilesInfo); foreach (var childCommand in commandConfiguration.ChildCommands) { var helper = new Helper(commandConfiguration, childCommand); command.AddCommand(childCommand.StepName, new ChildCommandConfiguration() { StepName = childCommand.StepName, StepNumber = childCommand.StepNumber, Command = _commandFactory.GetCommand(childCommand.CommandName), FileInputProvider = helper, InputParamProvider = helper, OutputPath = childCommand.OutputPath, }); } return(command); }
internal Helper(JsonCompositeCommandConfiguration commandConfiguration, JsonChildCommandConfiguration childCommandConfiguration) { _childCommandConfiguration = childCommandConfiguration; _parentInputFilesInfo = commandConfiguration.ExpectedInputFilesInfo; _parentCommandName = commandConfiguration.CommandName; if (commandConfiguration.CustomObjects != null) { commandConfiguration.CustomObjects.ToList().ForEach(o => _customObjects.Add(o.Name, o.Value)); } }