GetEngineByFileExtension() public method

public GetEngineByFileExtension ( string fileExtension ) : ScriptEngine
fileExtension string
return ScriptEngine
コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DlrTask"/> class.
        /// </summary>
        /// <param name="factory">The Factory</param>
        /// <param name="xmlElement">The XElement</param>
        /// <param name="taskFactoryLoggingHost">The taskFactoryLoggingHost</param>
        internal DlrTask(DlrTaskFactory factory, XElement xmlElement, IBuildEngine taskFactoryLoggingHost)
        {
            this.xelement = xmlElement;
            this.language = GetLanguage(xmlElement);

            var srs = new ScriptRuntimeSetup();
            srs.LanguageSetups.Add(IronRuby.Ruby.CreateRubySetup());
            srs.LanguageSetups.Add(IronPython.Hosting.Python.CreateLanguageSetup(null));
            var runtime = new ScriptRuntime(srs);
            this.engine = runtime.GetEngineByFileExtension(this.language);
            this.scope = this.engine.CreateScope();
            this.scope.log = this.Log;
        }
コード例 #2
0
ファイル: DlrTask.cs プロジェクト: jredville/DlrTaskFactory
        /// <summary>
        /// Initializes a new instance of the <see cref="DlrTask"/> class.
        /// </summary>
        internal DlrTask(DlrTaskFactory factory, XElement xElement, IBuildEngine taskFactoryLoggingHost)
        {
            Contract.Requires(factory != null);
            Contract.Requires(xElement != null);
            Contract.Requires(taskFactoryLoggingHost != null);

            this.taskFactory = factory;
            this.xElement = xElement;
            this.language = GetLanguage(xElement);
            this.taskFactoryLoggingHost = taskFactoryLoggingHost;

            var srs = new ScriptRuntimeSetup();
            srs.LanguageSetups.Add(IronRuby.Ruby.CreateRubySetup());
            srs.LanguageSetups.Add(IronPython.Hosting.Python.CreateLanguageSetup(null));
            var runtime = new ScriptRuntime(srs);
            engine = runtime.GetEngineByFileExtension(language);
            scope = engine.CreateScope();
            scope.log = this.Log;
        }