示例#1
0
        public static Type GetCompiledType(string inputFile, HttpContext context)
        {
#if NET_2_0
            return(BuildManager.GetCompiledType(inputFile));
#else
            string      physPath;
            HttpRequest req = context != null ? context.Request : null;

            if (req != null)
            {
                physPath = req.MapPath(inputFile);
            }
            else             // likely to fail
            {
                physPath = inputFile;
            }

            WebServiceParser parser = new WebServiceParser(context, inputFile, physPath);
            Type             type   = parser.GetCompiledTypeFromCache();
            if (type != null)
            {
                return(type);
            }

            return(WebServiceCompiler.CompileIntoType(parser));
#endif
        }
        /// <include file='doc\SimpleWebHandlerParser.uex' path='docs/doc[@for="WebServiceParser.GetCompiledType"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public static Type GetCompiledType(string inputFile, HttpContext context)
        {
            // Only allowed in full trust (ASURT 123890)
            InternalSecurityPermissions.UnmanagedCode.Demand();

            WebServiceParser parser = new WebServiceParser(context, null /*virtualPath*/, inputFile);

            return(parser.GetCompiledTypeFromCache());
        }
		public static Type GetCompiledType (string inputFile, HttpContext context)
		{
			WebServiceParser parser = new WebServiceParser (context, null, inputFile);
			Type type = parser.GetCompiledTypeFromCache ();
			if (type != null)
				return type;

			return WebServiceCompiler.CompileIntoType (parser);
		}
		public static Type GetCompiledType (string inputFile, HttpContext context)
		{
#if NET_2_0
			return BuildManager.GetCompiledType (inputFile);
#else
			string physPath;
			HttpRequest req = context != null ? context.Request : null;
			
			if (req != null)
				physPath = req.MapPath (inputFile);
			else // likely to fail
				physPath = inputFile;
			
			WebServiceParser parser = new WebServiceParser (context, inputFile, physPath);
			Type type = parser.GetCompiledTypeFromCache ();
			if (type != null)
				return type;

			return WebServiceCompiler.CompileIntoType (parser);
#endif
		}