Author: mhutch
Date: 2007-10-17 10:57:30 -0400 (Wed, 17 Oct 2007)
New Revision: 87683
Modified:
trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
trunk/monodevelop/Extras/AspNetAddIn/Parser/DocumentReferenceManager.cs
trunk/monodevelop/Extras/AspNetAddIn/Parser/MemberListVisitor.cs
trunk/monodevelop/Extras/AspNetAddIn/Parser/WebFormReferenceManager.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/WebTypeManager.cs
Log:
* Project/WebTypeManager.cs: Don't do web.config control lookups for
1.1 projects.
* Parser/WebFormReferenceManager.cs: Track API change.
* Parser/MemberListVisitor.cs, Parser/DocumentReferenceManager.cs:
Handle the "type" property of "input" HTML controls.
Modified: trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2007-10-17 14:52:18 UTC
(rev 87682)
+++ trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2007-10-17 14:57:30 UTC
(rev 87683)
@@ -1,3 +1,11 @@
+2007-10-17 Michael Hutchinson <[EMAIL PROTECTED]>
+
+ * Project/WebTypeManager.cs: Don't do web.config control lookups for 1.1
+ projects.
+ * Parser/WebFormReferenceManager.cs: Track API change.
+ * Parser/MemberListVisitor.cs, Parser/DocumentReferenceManager.cs:
Handle
+ the "type" property of "input" HTML controls.
+
2007-10-16 Michael Hutchinson <[EMAIL PROTECTED]>
* Project/AspNetAppProject.cs, Project/VerifyCodeBehindBuildStep.cs,
Modified:
trunk/monodevelop/Extras/AspNetAddIn/Parser/DocumentReferenceManager.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Parser/DocumentReferenceManager.cs
2007-10-17 14:52:18 UTC (rev 87682)
+++ trunk/monodevelop/Extras/AspNetAddIn/Parser/DocumentReferenceManager.cs
2007-10-17 14:57:30 UTC (rev 87683)
@@ -61,9 +61,13 @@
public string GetTypeName (string tagPrefix, string tagName)
{
+ return GetTypeName (tagPrefix, tagName, null);
+ }
+
+ public string GetTypeName (string tagPrefix, string tagName,
string htmlTypeAttribute)
+ {
if (tagPrefix == null || tagPrefix.Length < 1)
- //FIXME: need to pass 'type' attributes to look
up input types correctly
- return
doc.Project.WebTypeManager.HtmlControlLookup (tagName);
+ return
doc.Project.WebTypeManager.HtmlControlLookup (tagName, htmlTypeAttribute);
if (0 == string.Compare (tagPrefix, "asp", true,
CultureInfo.InvariantCulture))
return
doc.Project.WebTypeManager.SystemWebControlLookup (tagName);
@@ -86,11 +90,9 @@
string globalLookup =
doc.Project.WebTypeManager.GetGloballyRegisteredTypeName
(System.IO.Path.GetDirectoryName
(doc.ProjectFile.FilePath), tagPrefix, tagName);
- if (globalLookup != null)
- return globalLookup;
- //FIXME: use nicer error
- throw new Exception ("The tag prefix \"" + tagPrefix +
"\" has not been registered");
+ //returns null if type not found
+ return globalLookup;
}
#region directive classes
Modified: trunk/monodevelop/Extras/AspNetAddIn/Parser/MemberListVisitor.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Parser/MemberListVisitor.cs
2007-10-17 14:52:18 UTC (rev 87682)
+++ trunk/monodevelop/Extras/AspNetAddIn/Parser/MemberListVisitor.cs
2007-10-17 14:57:30 UTC (rev 87683)
@@ -72,13 +72,13 @@
string typeName = null;
try {
- typeName = doc.ReferenceManager.GetTypeName
(prefix, name);}
- catch (Exception e) {
+ typeName = doc.ReferenceManager.GetTypeName
(prefix, name, node.Attributes ["type"] as string);
+ } catch (Exception e) {
throw new ParserException (node.Location,
e.ToString ());
}
if (typeName == null)
- throw new ParserException (node.Location,
GettextCatalog.GetString ("Could not find tag type: '{0}{1}{2}'.", prefix,
string.IsNullOrEmpty(prefix)? string.Empty:":", name));
+ throw new ParserException (node.Location,
GettextCatalog.GetString ("The tag type '{0}{1}{2}' has not been registered.",
prefix, string.IsNullOrEmpty(prefix)? string.Empty:":", name));
CodeTypeReference ctRef = new CodeTypeReference
(typeName);
CodeMemberField member = new CodeMemberField (ctRef,
id);
Modified: trunk/monodevelop/Extras/AspNetAddIn/Parser/WebFormReferenceManager.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Parser/WebFormReferenceManager.cs
2007-10-17 14:52:18 UTC (rev 87682)
+++ trunk/monodevelop/Extras/AspNetAddIn/Parser/WebFormReferenceManager.cs
2007-10-17 14:57:30 UTC (rev 87683)
@@ -57,6 +57,8 @@
public Type GetObjectType (string tagPrefix, string typeName)
{
string fullName = GetTypeName (tagPrefix, typeName);
+ if (fullName == null)
+ throw new Exception (string.Format ("The tag
type '{0}{1}{2}' has not been registered.", tagPrefix,
string.IsNullOrEmpty(tagPrefix)? string.Empty:":", typeName));
Type type = System.Type.GetType (fullName, false);
if (type != null)
return type;
Modified: trunk/monodevelop/Extras/AspNetAddIn/Project/WebTypeManager.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/WebTypeManager.cs
2007-10-17 14:52:18 UTC (rev 87682)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/WebTypeManager.cs
2007-10-17 14:57:30 UTC (rev 87683)
@@ -55,6 +55,10 @@
public string GetGloballyRegisteredTypeName (string
webDirectory, string tagPrefix, string tagName)
{
+ //global control registration not possible in ASP.NET
1.1
+ if (project.ClrVersion ==
MonoDevelop.Core.ClrVersion.Net_1_1)
+ return null;
+
//read the web.config files at each level
//look up a level if a result not found until we hit
the project root
DirectoryInfo dir = new DirectoryInfo (webDirectory);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches