GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — scriptcs/src/ScriptCs.Core/ScriptEnvironment.cs at dev · scriptcs/scriptcs Expand file tree/ Copy pathScriptEnvironment.csMore file actions 57 lines (47 loc) · 1.58 KB / Copy pathScriptEnvironment.csFile metadata and controls57 lines (47 loc) · 1.58 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using ScriptCs.Contracts; namespace ScriptCs { public class ScriptEnvironment : IScriptEnvironment { private readonly IConsole _console; private readonly Printers _printers; private readonly IScriptInfo _scriptInfo; public ScriptEnvironment(string[] scriptArgs, IConsole console, Printers printers, IScriptInfo scriptInfo = null ) { _console = console; _printers = printers; _scriptInfo = scriptInfo; ScriptArgs = scriptArgs; } public IReadOnlyList<string> ScriptArgs { get; private set; } public void AddCustomPrinter<T>(Func<T, string> printer) { _console.WriteLine("Adding custom printer for " + typeof(T).Name); _printers.AddCustomPrinter<T>(printer); } public void Print(object o) { _console.WriteLine(_printers.GetStringFor(o)); } public void Print<T>(T o) { _console.WriteLine(_printers.GetStringFor<T>(o)); } public string ScriptPath => _scriptInfo.ScriptPath; public string[] LoadedScripts => _scriptInfo.LoadedScripts.ToArray(); public Assembly ScriptAssembly { get; private set; } private bool _initialized; public void Initialize() { if (!_initialized) { ScriptAssembly = Assembly.GetCallingAssembly(); _initialized = true; } } } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |