public string call(string macroName, PythonDictionary parameters = null) { var macro = _context.Macros.FirstOrDefault(o => o.Name == macroName); var script = macro.Script; if (parameters != null) { var macroParameters = new MacroScriptParameters(); foreach (var k in parameters.keys()) { macroParameters.SetParameter((string)k, (string)parameters.get((string)k)); } script = macroParameters.ReplaceParameters(macro); } var result = _runner.RunScript(script, _ledger, _context); return(result); }
private void GetObjectData(SerializationInfo info, StreamingContext context) { ContractUtils.RequiresNotNull(info, "info"); info.AddValue("__class__", _class); List <object> keys = new List <object>(); List <object> values = new List <object>(); foreach (object o in _dict.keys()) { keys.Add(o); object value; bool res = _dict.TryGetValue(o, out value); Debug.Assert(res); values.Add(value); } info.AddValue("keys", keys); info.AddValue("values", values); }
public object keys(CodeContext context) { return(Dictionary.keys()); }