public void Initialize(Context context, ScriptingContext scriptContext) { _context = context; _scriptContext = scriptContext; _scriptContext.OnTaskReceive = this.AddTask; _scriptContext.OnSyncTask = this.ExecuteTask; _scriptContext.OnCodeInject = this.GetCodeToInject; _api = Activator.CreateInstance(_context.Config.ApiProviderType) as IApiProvider; _api.RegisterAvailableModules(_context); this.Start(); }
private void HookIntoView(Dispatcher dispatcher) { ScriptingContext sc = new ScriptingContext(); _context.Host.View.RegisterJsObject("polarisConn", sc); dispatcher.Initialize(_context, sc); }