2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.Web / System.Web.Compilation / BuildProviderGroup.cs
blobad5fd1f0363e442b38267b30f93be2dd08890da6
1 //
2 // System.Web.Compilation.BuildManagerDirectoryBuilder
3 //
4 // Authors:
5 // Marek Habersack (mhabersack@novell.com)
6 //
7 // (C) 2008-2009 Novell, Inc (http://www.novell.com)
8 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System;
32 using System.Collections.Generic;
34 namespace System.Web.Compilation
36 class BuildProviderGroup : List <BuildProvider>
38 // Prefix for the assembly to be generated
39 public string NamePrefix {
40 get;
41 private set;
44 // Can the group accept only one build provider
45 public bool Standalone {
46 get; set;
49 // Is the group for global.asax
50 public bool Application
52 get;
53 private set;
56 // Does the group contain the originally requested virtual path
57 public bool Master {
58 get; set;
61 // Compiler type for this group
62 public CompilerType CompilerType {
63 get;
64 private set;
67 public BuildProviderGroup ()
71 public void AddProvider (BuildProvider bp)
73 if (Count == 0) {
74 // We need to set the name prefix
75 if (bp is ApplicationFileBuildProvider) {
76 NamePrefix = "App_global.asax";
77 Application = true;
78 } else if (bp is ThemeDirectoryBuildProvider) {
79 NamePrefix = "App_Theme";
80 Master = true;
81 } else
82 NamePrefix = "App_Web";
84 CompilerType ct = BuildManager.GetDefaultCompilerTypeForLanguage (bp.LanguageName, null);
85 if (ct != null)
86 CompilerType = ct;
89 Add (bp);