コード例 #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
        /// <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;
        }