Exemplo n.º 1
0
        /// <summary>
        /// Execute code within a given module context and returns the result.
        /// The module must be local with respect to the compiled code object.
        /// </summary>
        public object Evaluate(IScriptModule module)
        {
            ScriptModule localModule;

            if (module == null)
            {
                localModule = RemoteWrapper.TryGetLocal <ScriptModule>(ScriptDomainManager.CurrentManager.Host.DefaultModule);
            }
            else
            {
                localModule = RemoteWrapper.GetLocalArgument <ScriptModule>(module, "module");
            }

            return(_code.Run(localModule));
        }
Exemplo n.º 2
0
 // Gets a LanguageContext for the specified module that captures the current state
 // of the module which will be used for compilation and execution of the next piece of code against the module.
 private CodeContext GetCodeContext(IScriptModule module)
 {
     return(GetCodeContext(RemoteWrapper.GetLocalArgument <ScriptModule>(module ??
                                                                         ScriptDomainManager.CurrentManager.Host.DefaultModule, "module")));
 }
Exemplo n.º 3
0
 public void PublishModule(IScriptModule module, string publicName)
 {
     _manager.PublishModule(RemoteWrapper.GetLocalArgument <ScriptModule>(module, "module"), publicName);
 }