public T CreateArgument <T>(string argumentName) where T : IApplicationArgument { if (!ArgumentIsEnabled(argumentName)) { throw new ApplicationArgumentException($"Argument ({argumentName}) it is not enabled on this application."); } IApplicationArgument applicationArgument = null; try { applicationArgument = _arguments[argumentName].Invoke(_mappedArguments[argumentName]); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); throw ex; } return((T)applicationArgument); }
public ApplicationArgumentsGetter(IApplicationArgument[] applicationArguments) { _applicationArguments = applicationArguments; }