public EngineBuilder() { _fileSystem = Dummy.Of <IFileSystem>(); _commandFactory = new StubCommandFactory(new Command("dummy", passThroughArgs => passThroughArgs)); _commandLineExecutor = Dummy.Of <ICommandLineExecutor>(); _variableHelper = new FakePassthroughVariableHelper(); }
public static StringBuilder ParseString(this StringBuilder sb, IVariableHelper helper, CommandParser parser, ReportData data = null) { int varPosition; var startIndex = 0; do { const string chars = "$%&"; var anyOf = chars.ToCharArray(); varPosition = sb.IndexOfAny(anyOf, startIndex); if (varPosition == -1) { continue; } //// Is it a valid variable? if (helper.GetDelegate(sb.Substring(varPosition, 2)).IsNotNull()) { sb.ReplaceFirst(sb.Substring(varPosition, 2), parser.ParseVariable(sb.Substring(varPosition, 2), data)); } startIndex = varPosition + 1; }while (varPosition != -1); return(sb); }
public CommandManager(IVariableHelper variableHelper, [Named("CommandHelper")] IHelper <Action> commandHelper, ICommandRepository commandRepository, ICommandInitializer commandInitializer) { VariableHelper = variableHelper; CommandHelper = commandHelper; CommandRepository = (CommandRepository)commandRepository; CommandInitializer = (CommandInitializer)commandInitializer; }
public Engine(IFileSystem fileSystem, ICommandFactory commandFactory, ICommandLineExecutor commandLineExecutor, IVariableHelper variableHelper, ILogger logger, ISplashScreen splashScreen) { _fileSystem = fileSystem; _commandFactory = commandFactory; _commandLineExecutor = commandLineExecutor; _variableHelper = variableHelper; _logger = logger; _splashScreen = splashScreen; }
public EngineBuilder WithVariableHelper(IVariableHelper variableHelper) { _variableHelper = variableHelper; return(this); }
public CommandParser(IVariableHelper helper, ICommandManager commandManager) : base(commandManager) { Helper = helper; }