Exemplo n.º 1
0
        private static void InitializeScriptEngine()
        {
            IScriptEngineContext context = ScriptEngineContext.Current;

            context.RegisterType("DateTime", typeof(DateTime));
            context.RegisterType("Guid", typeof(Guid));
            context.RegisterType("Query", typeof(Query));
            context.RegisterType("Workflow", typeof(Workflow));
            context.RegisterType("DialogResult", typeof(Dialog.Result));
            context.RegisterType("Dictionary", ValueStackContext.Current.CreateDictionary().GetType());
            context.RegisterType("List", typeof(System.Collections.ArrayList));
            context.RegisterType("HttpRequest", typeof(HttpRequest));
        }
Exemplo n.º 2
0
        public ExecutionVisitor(Options options, IScriptEngineContext context)
        {
            this.scriptEngineContext = context;
            this.methodInvoker = context.GetMethodInvoker(this);//new CachedMethodInvoker(this);
            this.propertyGetter = new CachedReflectionPropertyGetter(methodInvoker);
            this.constructorInvoker = new CachedConstructorInvoker(methodInvoker);
            this.typeResolver = context.GetTypeResolver();//new CachedTypeResolver();
            this.fieldGetter = new CachedReflectionFieldGetter(methodInvoker);

            GlobalScope = new JsObject();
            Global = new JsGlobal(this, options);
            GlobalScope.Prototype = Global as JsDictionaryObject;
            EnterScope(GlobalScope);
            CallStack = new Stack<string>();
        }
Exemplo n.º 3
0
 public static void Init(IScriptEngineContext context)
 {
     Current = context;
 }
Exemplo n.º 4
0
 public static void Init(IScriptEngineContext context)
 {
     Current = context;
 }