public Repl( string[] scriptArgs, IFileSystem fileSystem, IScriptEngine scriptEngine, IObjectSerializer serializer, ILogProvider logProvider, IScriptLibraryComposer composer, IConsole console, IFilePreProcessor filePreProcessor, IEnumerable <IReplCommand> replCommands, Printers printers, IScriptInfo scriptInfo) : base(fileSystem, filePreProcessor, scriptEngine, logProvider, composer, scriptInfo) { Guard.AgainstNullArgument("serializer", serializer); Guard.AgainstNullArgument("logProvider", logProvider); Guard.AgainstNullArgument("console", console); _scriptArgs = scriptArgs; _serializer = serializer; _printers = printers; _log = logProvider.ForCurrentType(); Console = console; Commands = replCommands != null?replCommands.Where(x => x.CommandName != null).ToDictionary(x => x.CommandName, x => x) : new Dictionary <string, IReplCommand>(); }
public ScriptEnvironment(string[] scriptArgs, IConsole console, Printers printers, IScriptInfo scriptInfo = null) { _console = console; _printers = printers; _scriptInfo = scriptInfo; ScriptArgs = scriptArgs; }
private void SendExporter(IScriptInfo scriptInfo) { var result = _exporter.Export(scriptInfo); if (!result) { } }
public bool Export(IScriptInfo scriptInfo) { var dt = DateTime.Now.ToString("G"); var trid = Thread.CurrentThread.ManagedThreadId; Console.WriteLine($"{dt}({trid}) script name: {scriptInfo.Name}"); Console.WriteLine($"{dt}({trid}) script body:"); Console.WriteLine(scriptInfo.Body); Console.WriteLine(new string('=', 32)); return(true); }
public PreprocessorTextReader(IStreamSource source, ICollection<string> predefinedVariables, IStreamResolver includeResolver, IScriptInfo scriptInfo) { Debug.Assert(source != null); _source = source; _includeResolver = includeResolver; _scriptInfo = scriptInfo; _definedVariables = new Dictionary<string, string>(); _activeInstructions = new Stack<Instruction>(); if ((predefinedVariables != null) && (predefinedVariables.Count != 0)) { foreach (string s in predefinedVariables) { _definedVariables[s] = String.Empty; } } _currentLinePosition = -1; }
public PreprocessorTextReader(IStreamSource source, ICollection <string> predefinedVariables, IStreamResolver includeResolver, IScriptInfo scriptInfo) { Debug.Assert(source != null); _source = source; _includeResolver = includeResolver; _scriptInfo = scriptInfo; _definedVariables = new Dictionary <string, string>(); _activeInstructions = new Stack <Instruction>(); if ((predefinedVariables != null) && (predefinedVariables.Count != 0)) { foreach (string s in predefinedVariables) { _definedVariables[s] = String.Empty; } } _currentLinePosition = -1; }
public void Add(IScriptInfo info) { _scripts.AddOrUpdate(info.UniqueKey, key => { info.ItemOrder = _scripts.Count; if (info.IsInline) { info.LastModified = DateTime.Today; } return info; }, (key, existingVal) => { if (info.IsInline) { info.ItemOrder = existingVal.ItemOrder; info.LastModified = (info.LocalPath == existingVal.LocalPath) ? existingVal.LastModified : DateTime.Now; return info; } return existingVal; }); }
public ScriptHostFactory(IConsole console, Printers printers, IScriptInfo scriptInfo) { _console = console; _printers = printers; _scriptInfo = scriptInfo; }
public void Add(IScriptInfo info) { if (info == null) { throw new ArgumentNullException("info"); } IScriptFileList list = ListForType(info.ScriptType); list.Add(info); SaveList(info.ScriptType, list); }
internal ScriptPreprocessor(IStreamResolver includeResolver, IErrorHandler errorHandler, IScriptInfo scriptInfo) { _scriptInfo = scriptInfo; _includeResolver = includeResolver; _errorHandler = errorHandler; }
public void Add(IScriptInfo scriptInfo) { base.BaseAdd(scriptInfo as ScriptInfo); }
public DebugScriptExecutor(IFileSystem fileSystem, IFilePreProcessor filePreProcessor, IScriptEngine scriptEngine, ILogProvider logProvider, IScriptLibraryComposer composer, IScriptInfo scriptInfo) : base(fileSystem, filePreProcessor, scriptEngine, logProvider, composer, scriptInfo) { }