IncludeScript() private method

Performs PHP inclusion on a specified script.

The inclusion inheres in adding the target to the list of included scripts on the current script context (see ScriptContext.Scripts and in a call to the global code of the target script.

Request context has been disposed. or are null references. Script type cannot be resolved. The target assembly is not a valid Phalanger compiled assembly.
private IncludeScript ( string relativeSourcePath, System.ScriptInfo script ) : object
relativeSourcePath string /// Path to the target script source file relative to the application source root /// (see Configuration.Application.Compiler.SourceRoot. ///
script System.ScriptInfo /// Script type (i.e. type called Default representing the target script) or any type from /// the assembly where the target script is contained (useful for multi-script assemblies, where script types are /// not directly available from C# as they have mangled names). In the latter case, the script type is searched in the /// assembly using value of . ///
return object
Ejemplo n.º 1
0
        /// <summary>
        /// Performs PHP inclusion on a specified script. Equivalent to <see cref="PHP.Core.ScriptContext.IncludeScript"/>.
        /// </summary>
        /// <param name="relativeSourcePath">
        /// Path to the target script source file relative to the web application root.
        /// </param>
        /// <param name="script">
        /// Script info (i.e. type called <c>Default</c> representing the target script) or any type from
        /// the assembly where the target script is contained. In the latter case, the script type is searched in the
        /// assembly using value of <paramref name="relativeSourcePath"/>.
        /// </param>
        /// <returns>The value returned by the global code of the target script.</returns>
        /// <exception cref="InvalidOperationException">Request context has been disposed.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="relativeSourcePath"/> or <paramref name="script"/> are <B>null</B> references.</exception>
        /// <exception cref="ArgumentException">Script type cannot be resolved.</exception>
        /// <exception cref="InvalidScriptAssemblyException">The target assembly is not a valid Phalanger compiled assembly.</exception>
        public object IncludeScript(string /*!*/ relativeSourcePath, ScriptInfo /*!*/ script)
        {
            if (disposed)
            {
                throw new InvalidOperationException(CoreResources.GetString("instance_disposed"));
            }

            return(scriptContext.IncludeScript(relativeSourcePath, script));
        }