コード例 #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));
        }
コード例 #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")));
 }
コード例 #3
0
ファイル: ScriptEnvironment.cs プロジェクト: clorton/IDM-CMS
 public void PublishModule(IScriptModule module, string publicName)
 {
     _manager.PublishModule(RemoteWrapper.GetLocalArgument <ScriptModule>(module, "module"), publicName);
 }