public ScriptGlobals(IScriptGlobalsHelper owner, Dispatcher dispatcher, CancellationToken token) { this.owner = owner ?? throw new ArgumentNullException(nameof(owner)); this.token = token; this.dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); printOptionsImpl = new PrintOptionsImpl(); }
IOutputWritable GetOutputWritable(PrintOptionsImpl printOptions, object value) { if (!printOptions.AutoColorizeObjects) { return(null); } return(value as IOutputWritable); }
void IScriptGlobalsHelper.PrintLine(ScriptGlobals globals, object color, PrintOptionsImpl printOptions, object value) { if (!IsCurrentScript(globals)) { return; } ObjectOutputLine(color, printOptions, value); }
void IScriptGlobalsHelper.PrintLine(ScriptGlobals globals, PrintOptionsImpl printOptions, object value) { if (!IsCurrentScript(globals)) { return; } replEditor.OutputPrintLine(Format(value, printOptions.RoslynPrintOptions)); }
public ScriptGlobals(IScriptGlobalsHelper owner, Dispatcher dispatcher, CancellationToken token) { if (owner == null) { throw new ArgumentNullException(); } this.owner = owner; this.token = token; this.dispatcher = dispatcher; this.printOptionsImpl = new PrintOptionsImpl(); }
void ObjectOutput(object color, PrintOptionsImpl printOptions, object value, bool startOnNewLine = false) { var writable = GetOutputWritable(printOptions, value); if (writable != null) { writable.WriteTo(OutputWriter.Create(this, startOnNewLine)); } else { ReplEditor.OutputPrint(Format(value, printOptions.RoslynPrintOptions), color, startOnNewLine); } }
void ObjectOutput(CachedWriter writer, object color, PrintOptionsImpl printOptions, object value) { var writable = GetOutputWritable(printOptions, value); if (writable != null) { writable.WriteTo(writer); } else { writer.Write(Format(value, printOptions.RoslynPrintOptions), color); } }
void ObjectOutputLine(object color, PrintOptionsImpl printOptions, object value, bool startOnNewLine = false) { ObjectOutput(color, printOptions, value, startOnNewLine); ReplEditor.OutputPrintLine(string.Empty, color); }
void IScriptGlobalsHelper.Print(ScriptGlobals globals, CachedWriter writer, object color, PrintOptionsImpl printOptions, object value) { if (!IsCurrentScript(globals)) { return; } ObjectOutput(writer, color, printOptions, value); }
public CachedWriter(ScriptGlobals owner) { this.owner = owner; PrintOptions = owner.PrintOptionsImpl.Clone(); cachedList = new List <ColorAndText>(); }
public CachedWriter(ScriptGlobals owner) { this.owner = owner; PrintOptions = owner.PrintOptionsImpl.Clone(); cachedList = new List<ColorAndText>(); }