Author: mhabersack
Date: 2007-04-26 21:00:43 -0400 (Thu, 26 Apr 2007)
New Revision: 76364

Modified:
   trunk/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
   trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
   trunk/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
Log:
2007-04-27  Marek Habersack  <[EMAIL PROTECTED]>

        * AspComponentFoundry.cs: formatting changes.
        AssemblyFoundry looks for the specified namespace+type in the
        top-level assemblies if necessary.

2007-04-27  Marek Habersack  <[EMAIL PROTECTED]>

        * TemplateControlParser.cs: 2.0 allows 'Namespace' without the
        'Assembly' attribute on tag prefix registration.

        * TemplateParser.cs: do not rely on assembly name being not null.



Modified: 
trunk/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs    
2007-04-27 00:23:19 UTC (rev 76363)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs    
2007-04-27 01:00:43 UTC (rev 76364)
@@ -51,7 +51,7 @@
                        foundries = new Hashtable 
(StringComparer.InvariantCultureIgnoreCase);
 #else
                        foundries = new Hashtable 
(CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                               CaseInsensitiveComparer.DefaultInvariant);
+                                                  
CaseInsensitiveComparer.DefaultInvariant);
 #endif
 
                        Assembly sw = typeof (AspComponentFoundry).Assembly;
@@ -73,16 +73,16 @@
                }
 
                public void RegisterFoundry (string foundryName,
-                                               Assembly assembly,
-                                               string nameSpace)
+                                            Assembly assembly,
+                                            string nameSpace)
                {
                        AssemblyFoundry foundry = new AssemblyFoundry 
(assembly, nameSpace);
                        InternalRegister (foundryName, foundry);
                }
 
                public void RegisterFoundry (string foundryName,
-                                               string tagName,
-                                               Type type)
+                                            string tagName,
+                                            Type type)
                {
                        TagNameFoundry foundry = new TagNameFoundry (tagName, 
type);
                        InternalRegister (foundryName, foundry);
@@ -90,16 +90,16 @@
 
 #if NET_2_0
                public void RegisterFoundry (string foundryName,
-                                               string tagName,
-                                               string source)
+                                            string tagName,
+                                            string source)
                {
                        TagNameFoundry foundry = new TagNameFoundry (tagName, 
source);
                        InternalRegister (foundryName, foundry);
                }
 
                public void RegisterAssemblyFoundry (string foundryName,
-                                                       string assemblyName,
-                                                       string nameSpace)
+                                                    string assemblyName,
+                                                    string nameSpace)
                {
                        AssemblyFoundry foundry = new AssemblyFoundry 
(assemblyName, nameSpace);
                        InternalRegister (foundryName, foundry);
@@ -272,9 +272,23 @@
                                if (assembly == null && assemblyName != null)
                                        assembly = GetAssemblyByName 
(assemblyName, true);
 #endif
+                               string typeName = String.Format ("{0}.{1}", 
nameSpace, componentName);
                                if (assembly != null)
-                                       return assembly.GetType (nameSpace + 
"." + componentName, true, true);
-                               
+                                       return assembly.GetType (typeName, 
true, true);
+
+#if NET_2_0
+                               IList tla = BuildManager.TopLevelAssemblies;
+                               if (tla != null && tla.Count > 0) {
+                                       Type ret = null;
+                                       foreach (Assembly asm in tla) {
+                                               if (asm == null)
+                                                       continue;
+                                               ret = asm.GetType (typeName, 
false, true);
+                                               if (ret != null)
+                                                       return ret;
+                                       }
+                               }
+#endif
                                return null;
                        }
 
@@ -365,7 +379,7 @@
                                }
 
                                string msg = String.Format ("Type {0} not 
registered for prefix {1}",
-                                       componentName, tagPrefix);
+                                                           componentName, 
tagPrefix);
                                throw new ApplicationException (msg);
                        }
                }

Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-04-27 
00:23:19 UTC (rev 76363)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2007-04-27 
01:00:43 UTC (rev 76364)
@@ -1,3 +1,9 @@
+2007-04-27  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * AspComponentFoundry.cs: formatting changes.
+       AssemblyFoundry looks for the specified namespace+type in the
+       top-level assemblies if necessary.
+
 2007-04-26  Marek Habersack  <[EMAIL PROTECTED]>
 
        * AssemblyBuilder.cs: handle compilation failures in a better

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-04-27 00:23:19 UTC 
(rev 76363)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-04-27 01:00:43 UTC 
(rev 76364)
@@ -1,3 +1,10 @@
+2007-04-27  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * TemplateControlParser.cs: 2.0 allows 'Namespace' without the
+       'Assembly' attribute on tag prefix registration.
+
+       * TemplateParser.cs: do not rely on assembly name being not null.
+
 2007-04-19  Gert Driesen  <[EMAIL PROTECTED]>
 
        * TemplateParser.cs: On 2.0 profile, allow namespace in ClassName

Modified: trunk/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs   
2007-04-27 00:23:19 UTC (rev 76363)
+++ trunk/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs   
2007-04-27 01:00:43 UTC (rev 76364)
@@ -124,9 +124,11 @@
                                string ns = GetString (atts, "Namespace", null);
                                string assembly = GetString (atts, "Assembly", 
null);
 
+#if !NET_2_0
                                if (ns != null && assembly == null)
                                        ThrowParseException ("Need an Assembly 
attribute with Namespace.");
-
+#endif
+                               
                                if (ns == null && assembly != null)
                                        ThrowParseException ("Need a Namespace 
attribute with Assembly.");
                                

Modified: trunk/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/TemplateParser.cs  2007-04-27 
00:23:19 UTC (rev 76363)
+++ trunk/mcs/class/System.Web/System.Web.UI/TemplateParser.cs  2007-04-27 
01:00:43 UTC (rev 76364)
@@ -195,8 +195,13 @@
                 internal void RegisterNamespace (string tagPrefix, string ns, 
string assembly)
                 {
                         AddImport (ns);
-                        Assembly ass = AddAssemblyByName (assembly);
-                        AddDependency (ass.Location);
+                        Assembly ass = null;
+                       
+                       if (assembly != null && assembly.Length > 0) {
+                               ass = AddAssemblyByName (assembly);
+                               AddDependency (ass.Location);
+                       }
+                       
                         RootBuilder.Foundry.RegisterFoundry (tagPrefix, ass, 
ns);
                 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to