* SessionStateModule.cs: If using cookieless sessions add an
[mono.git] / mcs / class / System.Web / System.Web.UI / ApplicationFileParser.cs
1 //
2 // System.Web.UI.ApplicationFileParser.cs
3 //
4 // Authors:
5 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
6 //
7 // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
8 //
9 using System;
10 using System.Web;
11 using System.Web.Compilation;
12
13 namespace System.Web.UI
14 {
15         sealed class ApplicationFileParser : TemplateParser
16         {
17                 public ApplicationFileParser (string fname, HttpContext context)
18                 {
19                         InputFile = fname;
20                         Context = context;
21                 }
22                 
23                 protected override Type CompileIntoType ()
24                 {
25                         GlobalAsaxCompiler compiler = new GlobalAsaxCompiler (this);
26                         return compiler.GetCompiledType ();
27                 }
28
29                 internal static Type GetCompiledApplicationType (string inputFile, HttpContext context)
30                 {
31                         ApplicationFileParser parser = new ApplicationFileParser (inputFile, context);
32                         AspGenerator generator = new AspGenerator (parser);
33                         return generator.GetCompiledType ();
34                 }
35
36                 internal override Type DefaultBaseType {
37                         get { return typeof (HttpApplication); }
38                 }
39
40                 internal override string DefaultDirectiveName {
41                         get { return "application"; }
42                 }
43
44                 internal override string BaseVirtualDir {
45                         get { return Context.Request.ApplicationPath; }
46                 }
47         }
48
49 }
50