mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* list: added new files. * System.Web.Compilation/AspElements.cs: added WebService directive. * System.Web.Compilation/WebServiceCompiler.cs: New file. * System.Web.UI/SimpleWebHandlerParser.cs: New file. * System.Web.UI/WebServiceParser.cs: New file. svn path=/trunk/mcs/; revision=7364
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
//
|
|
// System.Web.Compilation.WebServiceCompiler
|
|
//
|
|
// Authors:
|
|
// Gonzalo Paniagua Javier ([email protected])
|
|
//
|
|
// (C) 2002 Ximian, Inc (http://www.ximian.com)
|
|
//
|
|
using System;
|
|
using System.IO;
|
|
using System.Web.UI;
|
|
|
|
namespace System.Web.Compilation
|
|
{
|
|
class WebServiceCompiler
|
|
{
|
|
private WebServiceCompiler ()
|
|
{
|
|
}
|
|
|
|
public static Type CompileIntoType (SimpleWebHandlerParser wService)
|
|
{
|
|
string sourceFile = GenerateSourceFile (wService);
|
|
Type type = TemplateFactory.GetTypeFromSource (sourceFile);
|
|
if (type.FullName != wService.ClassName)
|
|
throw new ApplicationException (String.Format (
|
|
"Class={0}, but the class compiled is {1}",
|
|
wService.ClassName,
|
|
type.FullName));
|
|
|
|
return type;
|
|
}
|
|
|
|
private static string GenerateSourceFile (SimpleWebHandlerParser wService)
|
|
{
|
|
//FIXME: should get Tmp dir for this application
|
|
string csName = Path.GetTempFileName ();
|
|
StreamWriter output = new StreamWriter (File.OpenWrite (csName));
|
|
output.Write (wService.Program);
|
|
output.Close ();
|
|
return csName;
|
|
}
|
|
}
|
|
}
|
|
|