Beispiel #1
0
 public Form1()
 {
     InitializeComponent();
     _scriptHost = new ScriptHost();
     _scriptHost.LoadAssembly(typeof(jterry.scripting.api.IUnitOfWork).Assembly);
     _scriptHost.LoadAssembly(typeof(System.Windows.Forms.Form).Assembly);
     IUnitOfWork uow = new ChinookContext();
     _scriptHost.RegisterVariable("unitOfWork", uow);
 }
Beispiel #2
0
 private static void RegisterScriptVariable(ScriptHost host, string name, object value)
 {
     host.RegisterVariable(name, value);
 }
Beispiel #3
0
 private static TabbedScriptEditor CreateScriptEditor(ScriptHost host)
 {
     var dlg = new TabbedScriptEditor(host);
     dlg.AddScript(Properties.Settings.Default.DefaultScript);
     return dlg;
 }
Beispiel #4
0
 private static ScriptHost CreateScriptHost()
 {
     _scriptHost = new ScriptHost();
     return _scriptHost;
 }
 private void CreateScriptHost()
 {
     var app = HttpContext.Current.ApplicationInstance as Global;
     _scriptHost = app.ScriptHost;
 }