mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
* System.Web/HttpContext.cs: reformatted. * System.Web/HttpStaticObjectsCollection.cs: implemented GetEnumertor, CopyTo and the indexer. * System.Web.Compilation/PageCompiler.cs: fixed compilation. * System.Web.SessionState/HttpSessionState.cs: IsAbandoned is internal. * System.Web.SessionState/SessionDictionary.cs: scope fixes. * System.Web.SessionState/SessionStateModule.cs: added events. svn path=/trunk/mcs/; revision=6730
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
//
|
|
// System.Web.Compilation.PageCompiler
|
|
//
|
|
// 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 PageCompiler
|
|
{
|
|
private PageParser pageParser;
|
|
|
|
internal PageCompiler (PageParser pageParser)
|
|
{
|
|
this.pageParser = pageParser;
|
|
}
|
|
|
|
public static Type CompilePageType (PageParser pageParser)
|
|
{
|
|
string sourceFile = GenerateSourceFile (pageParser.InputFile);
|
|
return TemplateFactory.GetTypeFromSource (sourceFile);
|
|
}
|
|
|
|
private static string GenerateSourceFile (string inputFile)
|
|
{
|
|
Stream input = File.OpenRead (inputFile);
|
|
AspParser parser = new AspParser (inputFile, input);
|
|
parser.Parse ();
|
|
AspGenerator generator = new AspGenerator (inputFile, parser.Elements);
|
|
//FIXME: set properties here -> base type, interfaces,...
|
|
generator.ProcessElements ();
|
|
string code = generator.GetCode ().ReadToEnd ();
|
|
//FIXME: should get Tmp dir for this application
|
|
string csName = Path.GetTempFileName ();
|
|
StreamWriter output = new StreamWriter (File.OpenWrite (csName));
|
|
output.Write (code);
|
|
output.Close ();
|
|
return csName;
|
|
}
|
|
}
|
|
}
|