merge -r 58784:58785
[mono.git] / mcs / class / System.Web / System.Web.UI / TemplateParser.cs
index aad6114a1ae39bb7a4b27029bca479360b7b6304..8a82aca3bbfad06f20414100410a2327c214b2dd 100644 (file)
@@ -67,13 +67,9 @@ namespace System.Web.UI {
                string oc_header, oc_custom, oc_param, oc_controls;
                bool oc_shared;
                OutputCacheLocation oc_location;
-#if NET_2_0
-               string src;
-               string partialClassName;
-#endif
                Assembly srcAssembly;
                int appAssemblyIndex = -1;
-
+                
                internal TemplateParser ()
                {
                        imports = new ArrayList ();
@@ -92,22 +88,10 @@ namespace System.Web.UI {
                        imports.Add ("System.Web.UI.HtmlControls");
 
                        assemblies = new ArrayList ();
-#if NET_2_0
-                       bool addAssembliesInBin = false;
-                       foreach (AssemblyInfo info in CompilationConfig.Assemblies) {
-                               if (info.Assembly == "*")
-                                       addAssembliesInBin = true;
-                               else
-                                       AddAssemblyByName (info.Assembly);
-                       }
-                       if (addAssembliesInBin)
-                               AddAssembliesInBin ();
-#else
                        foreach (string a in CompilationConfig.Assemblies)
                                AddAssemblyByName (a);
                        if (CompilationConfig.AssembliesInBin)
                                AddAssembliesInBin ();
-#endif
 
                        language = CompilationConfig.DefaultLanguage;
                }
@@ -437,48 +421,21 @@ namespace System.Web.UI {
                        language = GetString (atts, "Language", CompilationConfig.DefaultLanguage);
                        strictOn = GetBool (atts, "Strict", CompilationConfig.Strict);
                        explicitOn = GetBool (atts, "Explicit", CompilationConfig.Explicit);
-
-                       string inherits = GetString (atts, "Inherits", null);
 #if NET_2_0
-                       // In ASP 2, the source file is actually integrated with
-                       // the generated file via the use of partial classes. This
-                       // means that the code file has to be confirmed, but not
-                       // used at this point.
-                       src = GetString (atts, "CodeFile", null);
-
-                       if (src != null && inherits != null) {
-                               // Make sure the source exists
-                               src = UrlUtils.Combine (BaseVirtualDir, src);
-                               string realPath = MapPath (src, false);
-                               if (!File.Exists (realPath))
-                                       ThrowParseException ("File " + src + " not found");
-
-                               // Verify that the inherits is a valid identify not a
-                               // fully-qualified name.
-                               if (!CodeGenerator.IsValidLanguageIndependentIdentifier (inherits))
-                                       ThrowParseException (String.Format ("'{0}' is not valid for 'inherits'", inherits));
-
-                               // We are going to create a partial class that shares
-                               // the same name as the inherits tag, so reset the
-                               // name. The base type is changed because it is the
-                               // code file's responsibilty to extend the classes
-                               // needed.
-                               partialClassName = inherits;
-
-                               // Add the code file as an option to the
-                               // compiler. This lets both files be compiled at once.
-                               compilerOptions += " " + realPath;
-                       } else if (inherits != null) {
-                               // We just set the inherits directly because this is a
-                               // Single-Page model.
-                               SetBaseType (inherits);
-                       }
+                       string src = GetString (atts, "CodeFile", null);
 #else
                        string src = GetString (atts, "Src", null);
-
+#endif
                        if (src != null)
                                srcAssembly = GetAssemblyFromSource (src);
 
+                       string inherits = GetString (atts, "Inherits", null);
+#if NET_2_0
+                       if (srcAssembly == null)
+                               className = inherits;
+                       else
+                               SetBaseType (inherits);
+#else
                        if (inherits != null)
                                SetBaseType (inherits);
 
@@ -541,18 +498,6 @@ namespace System.Web.UI {
                        set { inputFile = value; }
                }
 
-#if NET_2_0
-               internal bool IsPartial
-               {
-                       get { return src != null; }
-               }
-
-               internal string PartialClassName
-               {
-                       get { return partialClassName; }
-               }
-#endif
-
                internal string Text
                {
                        get { return text; }
@@ -690,17 +635,9 @@ namespace System.Web.UI {
                        get { return oc_param; }
                }
 
-#if NET_2_0
-               internal PagesSection PagesConfig {
-                       get {
-                               return WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
-                       }
-               }
-#else
                internal PagesConfiguration PagesConfig {
                        get { return PagesConfiguration.GetInstance (Context); }
                }
-#endif
        }
 }