1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
//
// System.Web.UI.ApplicationFileParser.cs
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
// (c) 2004 Novell, Inc. (http://www.novell.com)
//
using System;
using System.Collections;
using System.Web;
using System.Web.Compilation;
namespace System.Web.UI
{
sealed class ApplicationFileParser : TemplateParser
{
static ArrayList dependencies;
public ApplicationFileParser (string fname, HttpContext context)
{
InputFile = fname;
Context = context;
}
protected override Type CompileIntoType ()
{
return GlobalAsaxCompiler.CompileApplicationType (this);
}
internal static Type GetCompiledApplicationType (string inputFile, HttpContext context)
{
ApplicationFileParser parser = new ApplicationFileParser (inputFile, context);
AspGenerator generator = new AspGenerator (parser);
Type type = generator.GetCompiledType ();
dependencies = parser.Dependencies;
return type;
}
internal override void AddDirective (string directive, Hashtable atts)
{
if (String.Compare (directive, "application", true) != 0 &&
String.Compare (directive, "Import", true) != 0 &&
String.Compare (directive, "Assembly", true) != 0)
ThrowParseException ("Invalid directive: " + directive);
base.AddDirective (directive, atts);
}
internal static ArrayList FileDependencies {
get { return dependencies; }
}
internal override Type DefaultBaseType {
get { return typeof (HttpApplication); }
}
internal override string DefaultBaseTypeName {
get { return "System.Web.HttpApplication"; }
}
internal override string DefaultDirectiveName {
get { return "application"; }
}
internal override string BaseVirtualDir {
get { return Context.Request.ApplicationPath; }
}
}
}
|