public static object MessageBox(Environment e, object[] args) { try { if (e.GetObject(args[0].ToString()) != null) return System.Windows.Forms.MessageBox.Show(e.GetObject(args[0].ToString()).ToString(), "Notepad X"); else return System.Windows.Forms.MessageBox.Show(args[0] as string, "Notepad X"); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); return null; } }
public object Invoke(Environment e, object[] args) { foreach (object o in argnames) { // FIXME e.Set(o.ToString(), e.GetObject(o.ToString())); } return e.Run(Pieces.ToArray()); // TODO: remove args from env }
public override object Execute(Environment e, object[] args) { if (e.GetObject(fn) == null) throw new Exception("Function '" + fn + "' not defined!"); return (e.GetObject(fn) as Function)(e, this.args); }