public static void Instantiate(Assembly a, Hashtable table) { long st = 0; try { st = Environment.TickCount; CodeChunk chunk = (CodeChunk)a.CreateInstance("CsiChunk"); long ddt = Environment.TickCount - st; Write("time createinstance " + ddt + "\n"); st = Environment.TickCount; chunk.Go(table); } catch (Exception ex) { Print(ex.GetType() + " was thrown: " + ex.Message); } long dt = Environment.TickCount - st; Write("time = " + dt + " ... " + Interpreter.rawLine + "\n"); }
public static void Instantiate(Assembly a, Interpreter interp) { Hashtable table = interp.VarTable; try { CodeChunk chunk = (CodeChunk)a.CreateInstance("CsiChunk"); chunk.Go(table); // vs 0.8 we display the type and value of expressions. The variable $_ is // always set, which is useful if you want to save the result of the last // calculation. if (interp.returnsValue && DumpingValue) { object val = table["_"]; Type type = val.GetType(); string stype = type.ToString(); if (stype.StartsWith("System.")) // to simplify things a little bit... { stype = stype.Substring(7); } stype = "(" + stype + ")"; if (val is string) { Print(stype, "'" + val + "'"); } else if (val is IEnumerable) { Print(stype); Dumpl((IEnumerable)val); } else { Print(stype, val); } } } catch (Exception ex) { Print(ex.GetType() + " was thrown: " + ex.Message); } }