public void Initialize(Type replType) { Contract.ThrowIfNull(replType); _repl = (IRepl)Activator.CreateInstance(replType); _objectFormatter = _repl.CreateObjectFormatter(); _hostObject = new InteractiveHostObject(); _options = _options .WithBaseDirectory(Directory.GetCurrentDirectory()) .AddReferences(_hostObject.GetType().Assembly); _hostObject.ReferencePaths.AddRange(_options.SearchPaths); _hostObject.SourcePaths.AddRange(_sourceSearchPaths); Console.OutputEncoding = Encoding.UTF8; }
public Formatter(ObjectFormatter language, ObjectFormattingOptions options) { _options = options ?? ObjectFormattingOptions.Default; _language = language; }
public void Initialize(Type replType) { Contract.ThrowIfNull(replType); _repl = (IRepl)Activator.CreateInstance(replType); _objectFormatter = _repl.CreateObjectFormatter(); _hostObject = new InteractiveHostObject(); var options = ScriptOptions.Default .WithSearchPaths(DefaultReferenceSearchPaths) .WithBaseDirectory(Directory.GetCurrentDirectory()) .AddReferences(_hostObject.GetType().Assembly); _sourceSearchPaths = DefaultSourceSearchPaths; _hostObject.ReferencePaths.AddRange(options.SearchPaths); _hostObject.SourcePaths.AddRange(_sourceSearchPaths); _lastTask = Task.FromResult(new TaskResult(options, null)); Console.OutputEncoding = Encoding.UTF8; }