public WinFormMVE(MainForm form) { Encoding encoding = new UTF8Encoding(false); char line_split = '\n'; s.S slib = new s.S(line_split, encoding); slib.addDef("read", new s.library.Read(line_split, encoding)); slib.addDef("write", new s.library.Write()); slib.addDef("cache", new s.library.Cache()); //slib.addDef("build-element", new BuildElement()); slib.loadLib(s.LibPath.instance().calculate("mve/index.lisp"), "mve", s.Node <Object> .extend(DOM.build(), null)); s.Function fun = slib.run("./s/index/index.lisp") as s.Function; s.Node <Object> o = fun.exec(null) as s.Node <Object>; s.Function getElement = s.Node <Object> .kvs_find1st(o, "getElement") as s.Function; s.Function init = s.Node <Object> .kvs_find1st(o, "init") as s.Function; s.Function destroy = s.Node <Object> .kvs_find1st(o, "destroy") as s.Function; Control els = getElement.exec(null) as Control; form.Controls.Add(els); els.Dock = DockStyle.Fill; init.exec(null); form.FormClosing += new System.Windows.Forms.FormClosingEventHandler(form_FormClosing); this.destroy = destroy; }
public override object exec(s.Node <object> args) { Control c = args.First() as Control; args = args.Rest(); String key = args.First() as String; args = args.Rest(); s.Function act = args.First() as s.Function; if (key == "click") { c.Click += new EventHandler(new SEventHandle(act).run); } return(null); }
public SEventHandle(s.Function fun) { this.fun = fun; }