Ver Fonte

2009-04-29 Marek Habersack <[email protected]>

    	* MetaTable.cs: implemented the DataContextType,
    	DataContextPropertyName properties and the ToString method.

    	* MetaColumn.cs: implemented the Scaffold, DisplayName,
    	SortExpression, UIHint properties and the ToString method.

    	* DynamicField.cs: implemented

    	* DynamicDataManager.cs: partially implemented RegisterControl.
    	Added internal AutoFieldGenerator class, used by RegisterControl
    	when dealing with GridView.
    	Implemented some properties.

    	* DynamicDataExtensions.cs: implemented GetTable and FindMetaTable

    	* DynamicControl.cs: implemented parts of the class.

    2009-04-29  Marek Habersack  <[email protected]>

    	* DataBoundControl.cs: added InternalGetDataSource method, used by
    	DynamicData

    2009-04-29  Marek Habersack  <[email protected]>

    	* AssemblyInfo.cs: added InternalsVisibleTo for
    	System.Web.DynamicData

    2009-04-29  Marek Habersack  <[email protected]>

    	* Test/System.Web.DynamicData.ModelProviders/TableProviderTest.cs:
    	added

    	* System.Web.DynamicData_test.dll.sources: added
    	System.Web.DynamicData/DynamicDataManagerTest.cs,
    	System.Web.DynamicData/DynamicDataExtensionsTest.cs,
    	System.Web.DynamicData.ModelProviders/TableProviderTest.cs

    	* System.Web.DynamicData.dll.sources: added
    	System.Web.DynamicData.ModelProviders/DLinqAssociationProvider.cs
    	System.Web.DynamicData.ModelProviders/DLinqColumnProvider.cs
    	System.Web.DynamicData.ModelProviders/DLinqDataModelProvider.cs
    	System.Web.DynamicData.ModelProviders/DLinqTableProvider.cs and
    	removed
    	System.Web.DynamicData.ModelProviders/DLinqDataModelProviders.cs

    2009-04-29  Marek Habersack  <[email protected]>

    	* TableProvider.cs: implemented

    	* DLinqDataModelProvider.cs: renamed from
    	DLinqDataModelProviders.cs and moved some classes to separate
    	files.

    	* DLinqTableProvider.cs: moved to here from
    	DLinqDataModelProvider.cs

    	* DLinqColumnProvider.cs: moved to here from
    	DLinqDataModelProvider.cs

    	* DLinqAssociationProvider.cs: added

    2009-04-29  Marek Habersack  <[email protected]>

    	* DataBinder.cs: GetPropertyValue must throw also if propName is
    	empty.

    2009-04-23  Marek Habersack  <[email protected]>

    	* ContextConfiguration.cs: implemented all the methods and added a
    	parameterless constructor.

    2009-04-23  Marek Habersack  <[email protected]>

    	* System.Web.DynamicData_test.dll.sources: added
    	System.Web.DynamicData/ContextConfigurationTest.cs

    	* Makefile: tests need to be linked with
    	System.ComponentModel.DataAnnotations.dll

    2009-04-23  Marek Habersack  <[email protected]>

    	* AssociatedMetadataTypeTypeDescriptor.cs: added - doesn't add any
    	real functionality yet.

    	* AssociatedMetadataTypeTypeDescriptionProvider.cs: implemented
    	all the methods.

    2009-04-23  Marek Habersack  <[email protected]>

    	* System.ComponentModel.DataAnnotations_test.dll.sources: added

    	* System.ComponentModel.DataAnnotations.dll.sources: added
    	System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs

    	* Makefile: enabled tests

    2009-04-23  Marek Habersack  <[email protected]>

    	* ContextConfigurationTest.cs: added

svn path=/trunk/mcs/; revision=133003
Marek Habersack há 16 anos atrás
pai
commit
30140fbbfd
36 ficheiros alterados com 2218 adições e 158 exclusões
  1. 9 0
      mcs/class/System.ComponentModel.DataAnnotations/ChangeLog
  2. 9 1
      mcs/class/System.ComponentModel.DataAnnotations/Makefile
  3. 1 0
      mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources
  4. 15 6
      mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs
  5. 53 0
      mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs
  6. 8 0
      mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog
  7. 1 0
      mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations_test.dll.sources
  8. 26 0
      mcs/class/System.Web.DynamicData/ChangeLog
  9. 1 1
      mcs/class/System.Web.DynamicData/Makefile
  10. 16 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/ChangeLog
  11. 50 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqAssociationProvider.cs
  12. 69 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqColumnProvider.cs
  13. 1 62
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqDataModelProvider.cs
  14. 78 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqTableProvider.cs
  15. 10 12
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/TableProvider.cs
  16. 4 1
      mcs/class/System.Web.DynamicData/System.Web.DynamicData.dll.sources
  17. 24 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/ChangeLog
  18. 8 3
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/ContextConfiguration.cs
  19. 26 10
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicControl.cs
  20. 44 4
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs
  21. 81 13
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataManager.cs
  22. 132 27
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicField.cs
  23. 109 11
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/MetaColumn.cs
  24. 6 6
      mcs/class/System.Web.DynamicData/System.Web.DynamicData/MetaTable.cs
  25. 4 0
      mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources
  26. 178 0
      mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData.ModelProviders/TableProviderTest.cs
  27. 4 0
      mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/ChangeLog
  28. 54 0
      mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/ContextConfigurationTest.cs
  29. 153 0
      mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataExtensionsTest.cs
  30. 1023 0
      mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs
  31. 1 0
      mcs/class/System.Web/Assembly/AssemblyInfo.cs
  32. 5 0
      mcs/class/System.Web/Assembly/ChangeLog
  33. 5 0
      mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
  34. 4 0
      mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs
  35. 5 0
      mcs/class/System.Web/System.Web.UI/ChangeLog
  36. 1 1
      mcs/class/System.Web/System.Web.UI/DataBinder.cs

+ 9 - 0
mcs/class/System.ComponentModel.DataAnnotations/ChangeLog

@@ -1,3 +1,12 @@
+2009-04-23  Marek Habersack  <[email protected]>
+
+	* System.ComponentModel.DataAnnotations_test.dll.sources: added
+
+	* System.ComponentModel.DataAnnotations.dll.sources: added
+	System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs
+
+	* Makefile: enabled tests
+
 2008-10-14  Atsushi Enomoto  <[email protected]>
 
 	* Makefile, System.ComponentModel.DataAnnotations.dll :

+ 9 - 1
mcs/class/System.ComponentModel.DataAnnotations/Makefile

@@ -9,11 +9,19 @@ LIB_MCS_FLAGS = \
                 /r:System.Data.dll \
                 /r:System.Xml.dll \
 
-NO_TEST = yes
 
 ifeq (2.0, $(FRAMEWORK_VERSION))
 # This is a .NET 3.5 only assembly, but built during the 2.0 build
 LIB_MCS_FLAGS += -d:NET_3_5
 endif
 
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+
+ifneq (net_2_0, $(PROFILE))
+LIBRARY_NAME = dummy-System.Web.DynamicData.dll
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+endif
+
 include ../../build/library.make

+ 1 - 0
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources

@@ -2,6 +2,7 @@
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
 Assembly/AssemblyInfo.cs
+System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs
 System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs
 System.ComponentModel.DataAnnotations/DataType.cs
 System.ComponentModel.DataAnnotations/DataTypeAttribute.cs

+ 15 - 6
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs

@@ -34,22 +34,31 @@ namespace System.ComponentModel.DataAnnotations
 {
 	public class AssociatedMetadataTypeTypeDescriptionProvider : TypeDescriptionProvider
 	{
-		[MonoTODO]
+		Type type;
+		Type associatedMetadataType;
+		
 		public AssociatedMetadataTypeTypeDescriptionProvider (Type type)
 		{
-			throw new NotImplementedException ();
+			if (type == null)
+				throw new ArgumentNullException ("type");
+			
+			this.type = type;
 		}
 
-		[MonoTODO]
 		public AssociatedMetadataTypeTypeDescriptionProvider (Type type, Type associatedMetadataType)
 		{
-			throw new NotImplementedException ();
+			if (type == null)
+				throw new ArgumentNullException ("type");
+			if (associatedMetadataType == null)
+				throw new ArgumentNullException ("associatedMetadataType");
+			
+			this.type = type;
+			this.associatedMetadataType = associatedMetadataType;
 		}
 
-		[MonoTODO]
 		public override ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance)
 		{
-			throw new NotImplementedException ();
+			return new AssociatedMetadataTypeTypeDescriptor (base.GetTypeDescriptor (objectType, instance), type, associatedMetadataType);
 		}
 	}
 }

+ 53 - 0
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs

@@ -0,0 +1,53 @@
+//
+// AssociatedMetadataTypeTypeDescriptionProvider.cs
+//
+// Author:
+//	Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ComponentModel;
+
+namespace System.ComponentModel.DataAnnotations
+{
+	// This class currently adds no functionality to its base class.
+	class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor
+	{
+		Type type;
+		Type associatedMetadataType;
+		
+		public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type)
+			: this (parent, type, null)
+		{
+		}
+
+		public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type, Type associatedMetadataType)
+			: base (parent)
+		{
+			this.type = type;
+			this.associatedMetadataType = associatedMetadataType;
+		}
+	}
+}

+ 8 - 0
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog

@@ -1,3 +1,11 @@
+2009-04-23  Marek Habersack  <[email protected]>
+
+	* AssociatedMetadataTypeTypeDescriptor.cs: added - doesn't add any
+	real functionality yet.
+
+	* AssociatedMetadataTypeTypeDescriptionProvider.cs: implemented
+	all the methods.
+
 2008-10-14  Atsushi Enomoto  <[email protected]>
 
 	* AssociatedMetadataTypeTypeDescriptionProvider.cs

+ 1 - 0
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations_test.dll.sources

@@ -0,0 +1 @@
+System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProviderTests.cs

+ 26 - 0
mcs/class/System.Web.DynamicData/ChangeLog

@@ -1,3 +1,29 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* Test/System.Web.DynamicData.ModelProviders/TableProviderTest.cs:
+	added
+
+	* System.Web.DynamicData_test.dll.sources: added
+	System.Web.DynamicData/DynamicDataManagerTest.cs,
+	System.Web.DynamicData/DynamicDataExtensionsTest.cs,
+	System.Web.DynamicData.ModelProviders/TableProviderTest.cs
+
+	* System.Web.DynamicData.dll.sources: added
+	System.Web.DynamicData.ModelProviders/DLinqAssociationProvider.cs 
+	System.Web.DynamicData.ModelProviders/DLinqColumnProvider.cs
+	System.Web.DynamicData.ModelProviders/DLinqDataModelProvider.cs
+	System.Web.DynamicData.ModelProviders/DLinqTableProvider.cs and
+	removed
+	System.Web.DynamicData.ModelProviders/DLinqDataModelProviders.cs
+
+2009-04-23  Marek Habersack  <[email protected]>
+
+	* System.Web.DynamicData_test.dll.sources: added
+	System.Web.DynamicData/ContextConfigurationTest.cs
+
+	* Makefile: tests need to be linked with
+	System.ComponentModel.DataAnnotations.dll
+
 2008-10-16  Atsushi Enomoto  <[email protected]>
 
 	* Makefile : added -r:System.Data.

+ 1 - 1
mcs/class/System.Web.DynamicData/Makefile

@@ -20,7 +20,7 @@ ifeq (2.0, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NET_3_5
 endif
 
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.ComponentModel.DataAnnotations.dll
 
 EXTRA_DISTFILES =
 

+ 16 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/ChangeLog

@@ -1,3 +1,19 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* TableProvider.cs: implemented
+
+	* DLinqDataModelProvider.cs: renamed from
+	DLinqDataModelProviders.cs and moved some classes to separate
+	files.
+
+	* DLinqTableProvider.cs: moved to here from
+	DLinqDataModelProvider.cs
+
+	* DLinqColumnProvider.cs: moved to here from
+	DLinqDataModelProvider.cs
+
+	* DLinqAssociationProvider.cs: added
+
 2008-10-16  Atsushi Enomoto  <[email protected]>
 
 	* ColumnProvider.cs, TableProvider.cs : implemented constructors.

+ 50 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqAssociationProvider.cs

@@ -0,0 +1,50 @@
+//
+// DLinqAssociationProvider.cs
+//
+// Author:
+//	Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Data.Linq;
+using System.Data.Linq.Mapping;
+using System.Linq;
+using System.Security.Permissions;
+
+using DMetaModel = System.Data.Linq.Mapping.MetaModel;
+using DMetaTable = System.Data.Linq.Mapping.MetaTable;
+
+namespace System.Web.DynamicData.ModelProviders
+{
+	class DLinqAssociationProvider : AssociationProvider
+	{
+		public DLinqAssociationProvider (DLinqColumnProvider provider)
+		{
+		}
+	}
+}

+ 69 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqColumnProvider.cs

@@ -0,0 +1,69 @@
+//
+// DLinqColumnProvider.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Data.Linq;
+using System.Data.Linq.Mapping;
+using System.Linq;
+using System.Security.Permissions;
+
+using DMetaModel = System.Data.Linq.Mapping.MetaModel;
+using DMetaTable = System.Data.Linq.Mapping.MetaTable;
+
+namespace System.Web.DynamicData.ModelProviders
+{
+	class DLinqColumnProvider : ColumnProvider
+	{
+		public DLinqColumnProvider (TableProvider owner, MetaDataMember meta)
+			: base (owner)
+		{
+			if (owner == null)
+				throw new ArgumentNullException ("owner");
+			if (meta == null)
+				throw new ArgumentNullException ("meta");
+
+			this.meta = meta;
+
+			// FIXME: fill more
+			Name = meta.Name;
+			Nullable = meta.CanBeNull;
+		}
+
+		MetaDataMember meta;
+
+		[MonoTODO]
+		public override string ToString ()
+		{
+			return base.ToString ();
+		}
+	}
+}

+ 1 - 62
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqDataModelProviders.cs → mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqDataModelProvider.cs

@@ -4,7 +4,7 @@
 // Author:
 //	Atsushi Enomoto <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -76,65 +76,4 @@ namespace System.Web.DynamicData.ModelProviders
 			return factory ();
 		}
 	}
-
-	class DLinqTableProvider : TableProvider
-	{
-		public DLinqTableProvider (DataModelProvider owner, DMetaTable meta)
-			: base (owner)
-		{
-			EntityType = meta.RowType.Type;
-
-			Name = meta.TableName;
-			int idx = Name.LastIndexOf ('.');
-			Name = idx < 0 ? Name : Name.Substring (idx + 1);
-
-			var l = new List<ColumnProvider> ();
-			foreach (var c in meta.RowType.DataMembers)
-				l.Add (new DLinqColumnProvider (this, c));
-			columns = new ReadOnlyCollection<ColumnProvider> (l);
-		}
-
-		MetaTable table;
-		ReadOnlyCollection<ColumnProvider> columns;
-
-		public override ReadOnlyCollection<ColumnProvider> Columns {
-			get { return columns; }
-		}
-
-		public override IQueryable GetQuery (object context)
-		{
-			return ((DataContext) context).GetTable (EntityType);
-		}
-
-		public override string ToString ()
-		{
-			return base.ToString ();
-		}
-	}
-
-	class DLinqColumnProvider : ColumnProvider
-	{
-		public DLinqColumnProvider (TableProvider owner, MetaDataMember meta)
-			: base (owner)
-		{
-			if (owner == null)
-				throw new ArgumentNullException ("owner");
-			if (meta == null)
-				throw new ArgumentNullException ("meta");
-
-			this.meta = meta;
-
-			// FIXME: fill more
-			Name = meta.Name;
-			Nullable = meta.CanBeNull;
-		}
-
-		MetaDataMember meta;
-
-		[MonoTODO]
-		public override string ToString ()
-		{
-			return base.ToString ();
-		}
-	}
 }

+ 78 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/DLinqTableProvider.cs

@@ -0,0 +1,78 @@
+//
+// DLinqTableProvider.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Data.Linq;
+using System.Data.Linq.Mapping;
+using System.Linq;
+using System.Security.Permissions;
+
+using DMetaModel = System.Data.Linq.Mapping.MetaModel;
+using DMetaTable = System.Data.Linq.Mapping.MetaTable;
+
+namespace System.Web.DynamicData.ModelProviders
+{
+	class DLinqTableProvider : TableProvider
+	{
+		public DLinqTableProvider (DataModelProvider owner, DMetaTable meta)
+			: base (owner)
+		{
+			EntityType = meta.RowType.Type;
+
+			Name = meta.TableName;
+			int idx = Name.LastIndexOf ('.');
+			Name = idx < 0 ? Name : Name.Substring (idx + 1);
+
+			var l = new List<ColumnProvider> ();
+			foreach (var c in meta.RowType.DataMembers)
+				l.Add (new DLinqColumnProvider (this, c));
+			columns = new ReadOnlyCollection<ColumnProvider> (l);
+		}
+
+		MetaTable table;
+		ReadOnlyCollection<ColumnProvider> columns;
+
+		public override ReadOnlyCollection<ColumnProvider> Columns {
+			get { return columns; }
+		}
+
+		public override IQueryable GetQuery (object context)
+		{
+			return ((DataContext) context).GetTable (EntityType);
+		}
+
+		public override string ToString ()
+		{
+			return base.ToString ();
+		}
+	}
+}

+ 10 - 12
mcs/class/System.Web.DynamicData/System.Web.DynamicData.ModelProviders/TableProvider.cs

@@ -3,8 +3,9 @@
 //
 // Author:
 //	Atsushi Enomoto <[email protected]>
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -33,6 +34,7 @@ using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Linq;
 using System.Security.Permissions;
+using System.Web.UI;
 
 namespace System.Web.DynamicData.ModelProviders
 {
@@ -42,33 +44,29 @@ namespace System.Web.DynamicData.ModelProviders
 	{
 		protected TableProvider (DataModelProvider model)
 		{
-			if (model == null)
-				throw new ArgumentNullException ("model");
 			DataModel = model;
 		}
 
-		[MonoTODO]
 		public abstract ReadOnlyCollection<ColumnProvider> Columns { get; }
-		[MonoTODO]
+
 		public DataModelProvider DataModel { get; private set; }
-		[MonoTODO]
 		public virtual Type EntityType { get; protected set; }
-		[MonoTODO]
 		public virtual string Name { get; protected set; }
 
-		[MonoTODO]
 		public virtual object EvaluateForeignKey (object row, string foreignKeyName)
 		{
-			throw new NotImplementedException ();
+			return DataBinder.GetPropertyValue (row, foreignKeyName);
 		}
 
-		[MonoTODO]
 		public abstract IQueryable GetQuery (object context);
 
-		[MonoTODO]
 		public override string ToString ()
 		{
-			throw new NotImplementedException ();
+			string name = Name;
+			if (String.IsNullOrEmpty (name))
+				return base.ToString ();
+
+			return name;
 		}
 	}
 }

+ 4 - 1
mcs/class/System.Web.DynamicData/System.Web.DynamicData.dll.sources

@@ -5,7 +5,10 @@ Assembly/AssemblyInfo.cs
 System.Web.DynamicData.ModelProviders/AssociationDirection.cs
 System.Web.DynamicData.ModelProviders/AssociationProvider.cs
 System.Web.DynamicData.ModelProviders/ColumnProvider.cs
-System.Web.DynamicData.ModelProviders/DLinqDataModelProviders.cs
+System.Web.DynamicData.ModelProviders/DLinqAssociationProvider.cs
+System.Web.DynamicData.ModelProviders/DLinqColumnProvider.cs
+System.Web.DynamicData.ModelProviders/DLinqDataModelProvider.cs
+System.Web.DynamicData.ModelProviders/DLinqTableProvider.cs
 System.Web.DynamicData.ModelProviders/DataModelProvider.cs
 System.Web.DynamicData.ModelProviders/TableProvider.cs
 System.Web.DynamicData/ContextConfiguration.cs

+ 24 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData/ChangeLog

@@ -1,3 +1,27 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* MetaTable.cs: implemented the DataContextType,
+	DataContextPropertyName properties and the ToString method.
+
+	* MetaColumn.cs: implemented the Scaffold, DisplayName,
+	SortExpression, UIHint properties and the ToString method.
+
+	* DynamicField.cs: implemented
+
+	* DynamicDataManager.cs: partially implemented RegisterControl.
+	Added internal AutoFieldGenerator class, used by RegisterControl
+	when dealing with GridView.
+	Implemented some properties.
+
+	* DynamicDataExtensions.cs: implemented GetTable and FindMetaTable
+
+	* DynamicControl.cs: implemented parts of the class.
+
+2009-04-23  Marek Habersack  <[email protected]>
+
+	* ContextConfiguration.cs: implemented all the methods and added a
+	parameterless constructor.
+
 2008-10-21  Atsushi Enomoto  <[email protected]>
 
 	* DynamicDataRouteHandler.cs, DynamicDataRoute.cs, MetaTable.cs:

+ 8 - 3
mcs/class/System.Web.DynamicData/System.Web.DynamicData/ContextConfiguration.cs

@@ -3,8 +3,9 @@
 //
 // Author:
 //	Atsushi Enomoto <[email protected]>
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -32,6 +33,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
 using System.Globalization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -44,9 +46,12 @@ namespace System.Web.DynamicData
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class ContextConfiguration
 	{
-		[MonoTODO]
+		public ContextConfiguration ()
+		{
+			MetadataProviderFactory = (Type t) => new AssociatedMetadataTypeTypeDescriptionProvider (t);
+		}
+		
 		public Func<Type, TypeDescriptionProvider> MetadataProviderFactory { get; set; }
-		[MonoTODO]
 		public bool ScaffoldAllTables { get; set; }
 	}
 }

+ 26 - 10
mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicControl.cs

@@ -48,10 +48,10 @@ namespace System.Web.DynamicData
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class DynamicControl : Control, IAttributeAccessor, IFieldTemplateHost, IFieldFormattingOptions
 	{
-		[MonoTODO]
+		Dictionary <string, string> attributes;
+		
 		public DynamicControl ()
 		{
-			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
@@ -126,29 +126,45 @@ namespace System.Web.DynamicData
 		[Category ("Behavior")]
 		[DefaultValue ("")]
 		public virtual string ValidationGroup { get; set; }
-
-		[MonoTODO]
+		
 		public string GetAttribute (string key)
 		{
-			throw new NotImplementedException ();
+			if (attributes == null)
+				return null;
+
+			string ret;
+			if (attributes.TryGetValue (key, out ret))
+				return ret;
+
+			return null;
 		}
 
 		[MonoTODO]
 		protected override void OnInit (EventArgs e)
 		{
-			throw new NotImplementedException ();
+			base.OnInit (e);
 		}
 
-		[MonoTODO]
 		protected override void Render (HtmlTextWriter writer)
 		{
-			throw new NotImplementedException ();
+			base.Render (writer);
+			// Why override?
 		}
 
-		[MonoTODO]
+		internal void InternalSetAttributes (Dictionary <string, string> attributes)
+		{
+			this.attributes = attributes;
+		}
+		
 		public void SetAttribute (string key, string value)
 		{
-			throw new NotImplementedException ();
+			if (attributes == null)
+				attributes = new Dictionary <string, string> ();
+
+			if (attributes.ContainsKey (key))
+				attributes [key] = value;
+			else
+				attributes.Add (key, value);
 		}
 	}
 }

+ 44 - 4
mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataExtensions.cs

@@ -74,10 +74,24 @@ namespace System.Web.DynamicData
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
 		public static MetaTable FindMetaTable (this Control current)
 		{
-			throw new NotImplementedException ();
+			// .NET doesn't perform the check, we will
+			if (current == null)
+				throw new NullReferenceException ();
+
+			while (current != null) {
+				DataBoundControl dbc = current as DataBoundControl;
+				if (dbc != null) {
+					IDynamicDataSource dds = dbc.InternalGetDataSource () as IDynamicDataSource;
+					if (dds != null)
+						return dds.GetTable ();
+				}
+
+				current = current.NamingContainer;
+			}
+
+			return null;
 		}
 
 		[MonoTODO]
@@ -92,10 +106,36 @@ namespace System.Web.DynamicData
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		static string GetDataSourceId (IDynamicDataSource dataSource)
+		{
+			Control c = dataSource as Control;
+			if (c == null)
+				return String.Empty;
+			
+			return c.ID;
+		}
+		
 		public static MetaTable GetTable (this IDynamicDataSource dataSource)
 		{
-			throw new NotImplementedException ();
+			if (dataSource == null)
+				return null;
+
+			string entitySetName = dataSource.EntitySetName;
+			if (String.IsNullOrEmpty (entitySetName)) {
+				// LAMESPEC: MSDN says we should throw in this case, but .NET calls
+				// DynamicDataRouteHandler.GetRequestMetaTable(HttpContext
+				// httpContext) instead (eventually)
+				MetaTable ret = DynamicDataRouteHandler.GetRequestMetaTable (HttpContext.Current);
+				if (ret == null)
+					throw new InvalidOperationException ("The control '" + GetDataSourceId (dataSource) +
+									     "' does not have a TableName property and a table name cannot be inferred from the URL.");
+			}
+			
+			Type contextType = dataSource.ContextType;
+			if (contextType == null)
+				throw new InvalidOperationException ("The ContextType property of control '" + GetDataSourceId (dataSource) + "' must specify a data context");
+			
+			return MetaModel.GetModel (contextType).GetTable (entitySetName);
 		}
 
 		[MonoTODO]

+ 81 - 13
mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicDataManager.cs

@@ -3,8 +3,9 @@
 //
 // Author:
 //	Atsushi Enomoto <[email protected]>
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -38,6 +39,7 @@ using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 using System.Web.UI;
+using System.Web.UI.WebControls;
 using System.Web.DynamicData.ModelProviders;
 
 namespace System.Web.DynamicData
@@ -50,35 +52,101 @@ namespace System.Web.DynamicData
 	[PersistChildren (false)]
 	public class DynamicDataManager : Control
 	{
-		[MonoTODO]
+		private class AutoFieldGenerator : IAutoFieldGenerator
+		{
+			MetaTable table;
+			
+			public AutoFieldGenerator (MetaTable table)
+			{
+				this.table = table;
+			}
+			
+			public ICollection GenerateFields (Control ctl)
+			{
+				var ret = new List <DynamicField> ();
+				foreach (MetaColumn column in table.Columns) {
+					if (!column.Scaffold)
+						continue;
+					
+					var field = new DynamicField ();
+					field.DataField = column.Name;
+					ret.Add (field);
+				}
+				
+				return ret;
+			}
+		}
+		
 		public DynamicDataManager ()
 		{
-			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
-		public bool AutoLoadForeignKeys { get; set; }
+		public bool AutoLoadForeignKeys {
+			get;
+			set;
+		}
 
-		[MonoTODO]
 		[Browsable (false)]
-		public override bool Visible { get; set; }
+		public override bool Visible {
+			get { return true; }
+
+			// NOTE: it is supposed to throw the exception
+			set { throw new NotImplementedException (); }
+		}
 
-		[MonoTODO]
 		protected override void OnLoad (EventArgs e)
 		{
-			throw new NotImplementedException ();
+			base.OnLoad (e);
+
+			// Why override?
 		}
 
-		[MonoTODO]
 		public void RegisterControl (Control control)
 		{
-			throw new NotImplementedException ();
+			RegisterControl (control, false);
 		}
 
-		[MonoTODO]
 		public void RegisterControl (Control control, bool setSelectionFromUrl)
 		{
-			throw new NotImplementedException ();
+			// .NET doesn't check for null here, but since I don't like such code, we
+			// will do the check and throw the same exception as .NET
+			if (control == null)
+				throw new NullReferenceException ();
+
+			if (!ControlIsValid (control))
+				throw new Exception ("Controls of type " + control.GetType () + " are not supported.");
+
+			DataBoundControl dbc = control as DataBoundControl;
+			if (dbc != null) {
+				IDynamicDataSource dds = dbc.InternalGetDataSource () as IDynamicDataSource;
+				if (dds == null)
+					return;
+
+				MetaTable table = dds.GetTable ();
+				if (table == null)
+					return;
+			
+				GridView gv = control as GridView;
+				if (gv != null) {
+					gv.ColumnsGenerator = new AutoFieldGenerator (table);
+					return;
+				}
+			}
+		}
+
+		bool ControlIsValid (Control control)
+		{
+			if (control is Repeater) {
+				if (control.NamingContainer == null)
+					throw new HttpException ("The Repeater control '" + control.ID + "' does not have a naming container.");
+				return true;
+			}
+			
+			DataBoundControl dbc = control as DataBoundControl;
+			if (dbc == null)
+				return false;
+			
+			return true;
 		}
 	}
 }

+ 132 - 27
mcs/class/System.Web.DynamicData/System.Web.DynamicData/DynamicField.cs

@@ -3,8 +3,9 @@
 //
 // Author:
 //	Atsushi Enomoto <[email protected]>
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -44,30 +45,106 @@ namespace System.Web.DynamicData
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class DynamicField : DataControlField, IAttributeAccessor, IFieldFormattingOptions
 	{
-		[MonoTODO]
+		MetaColumn myColumn;
+		Dictionary <string, string> attributes;
+		
 		public DynamicField ()
 		{
-			throw new NotImplementedException ();
+			DataFormatString = String.Empty;
+			HtmlEncode = true;
+			NullDisplayText = String.Empty;
+		}
+		
+		public bool ApplyFormatInEditMode {
+			get; set;
 		}
 
-		[MonoTODO]
-		public bool ApplyFormatInEditMode { get; set; }
-		[MonoTODO]
-		public bool ConvertEmptyStringToNull { get; set; }
-		[MonoTODO]
-		public virtual string DataField { get; set; }
-		[MonoTODO]
-		public string DataFormatString { get; set; }
-		[MonoTODO]
-		public override string HeaderText { get; set; }
-		[MonoTODO]
-		public bool HtmlEncode { get; set; }
-		[MonoTODO]
-		public string NullDisplayText { get; set; }
-		[MonoTODO]
-		public override string SortExpression { get; set; }
-		[MonoTODO]
-		public virtual string UIHint { get; set; }
+		public bool ConvertEmptyStringToNull {
+			get; set;
+		}
+
+		public virtual string DataField {
+			get { return ViewState.GetString ("_DataField", String.Empty); }
+			set {
+				ViewState ["_DataField"] = value;
+				OnFieldChanged ();
+			}
+		}		
+
+		public string DataFormatString {
+			get; set;
+		}
+
+		public override string HeaderText {
+			get {
+				string s = ViewState.GetString ("headerText", null);
+				if (s != null)
+					return s;
+
+				MetaColumn column = MyColumn;
+				if (column != null)
+					return column.DisplayName;
+				
+				return DataField;
+			}
+			
+			set { base.HeaderText = value; }
+		}		
+
+		public bool HtmlEncode {
+			get; set;
+		}
+
+		MetaColumn MyColumn {
+			get {
+				if (myColumn != null)
+					return myColumn;
+				Control owner = Control;
+				if (owner == null)
+					return null;
+				
+				MetaTable table = owner.FindMetaTable ();
+				if (table == null)
+					return null;
+
+				myColumn = table.GetColumn (DataField);
+				return myColumn;
+			}
+		}
+		
+		public string NullDisplayText {
+			get; set;
+		}
+
+		public override string SortExpression {
+			get {
+				string s = ViewState.GetString ("sortExpression", null);
+				if (s != null)
+					return s;
+
+				MetaColumn column = MyColumn;
+				if (column != null)
+					return column.SortExpression;
+
+				return String.Empty;
+			}
+			
+			set { base.SortExpression = value; }
+		}		
+
+		public virtual string UIHint {
+			get {
+				string s = ViewState.GetString ("uiHint", null);
+				if (s == null)
+					return String.Empty;
+				return s;
+			}
+			
+			set {
+				ViewState ["uiHint"] = value;
+				OnFieldChanged ();
+			}
+		}
 
 		[MonoTODO]
 		protected override void CopyProperties (DataControlField newField)
@@ -87,22 +164,50 @@ namespace System.Web.DynamicData
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
 		public string GetAttribute (string key)
 		{
-			throw new NotImplementedException ();
+			if (attributes == null)
+				return null;
+
+			string ret;
+			if (attributes.TryGetValue (key, out ret))
+				return ret;
+
+			return null;
 		}
 
-		[MonoTODO]
 		public override void InitializeCell (DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
 		{
-			throw new NotImplementedException ();
+			if (cellType == DataControlCellType.Header || cellType == DataControlCellType.Footer) {
+				base.InitializeCell (cell, cellType, rowState, rowIndex);
+				return;
+			}
+
+			DynamicControl dc = new DynamicControl ();
+			dc.ApplyFormatInEditMode = ApplyFormatInEditMode;
+			dc.ConvertEmptyStringToNull = ConvertEmptyStringToNull;
+			dc.Column = MyColumn;
+			dc.DataField = DataField;
+			dc.DataFormatString = DataFormatString;
+			dc.HtmlEncode = HtmlEncode;
+			dc.Mode = (rowState & DataControlRowState.Edit) != 0 ? DataBoundControlMode.Edit :
+				(rowState & DataControlRowState.Insert) != 0 ? DataBoundControlMode.Insert : DataBoundControlMode.ReadOnly;
+			dc.NullDisplayText = NullDisplayText;
+			dc.UIHint = UIHint;
+			dc.InternalSetAttributes (attributes);
+			
+			cell.Controls.Add (dc);
 		}
 
-		[MonoTODO]
 		public void SetAttribute (string key, string value)
 		{
-			throw new NotImplementedException ();
+			if (attributes == null)
+				attributes = new Dictionary <string, string> ();
+
+			if (attributes.ContainsKey (key))
+				attributes [key] = value;
+			else
+				attributes.Add (key, value);
 		}
 	}
 }

+ 109 - 11
mcs/class/System.Web.DynamicData/System.Web.DynamicData/MetaColumn.cs

@@ -3,8 +3,9 @@
 //
 // Author:
 //	Atsushi Enomoto <[email protected]>
+//      Marek Habersack <[email protected]>
 //
-// Copyright (C) 2008 Novell Inc. http://novell.com
+// Copyright (C) 2008-2009 Novell Inc. http://novell.com
 //
 
 //
@@ -46,10 +47,16 @@ namespace System.Web.DynamicData
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class MetaColumn : IFieldFormattingOptions
 	{
+		MemberInfo dataFieldInfo;
+		string uiHint;
+		bool? scaffold;
+		bool? scaffoldReflected;
+		
 		internal MetaColumn (MetaTable table, ColumnProvider provider)
 		{
 			Table = table;
 			Provider = provider;
+			Model = table.Model;
 		}
 
 		[MonoTODO]
@@ -77,8 +84,9 @@ namespace System.Web.DynamicData
 		[MonoTODO]
 		public string Description { get; private set; }
 
-		[MonoTODO]
-		public string DisplayName { get; private set; }
+		public string DisplayName {
+			get { return Provider.Name; }
+		}
 
 		public PropertyInfo EntityTypeProperty {
 			get { return Provider.EntityTypeProperty; }
@@ -142,25 +150,115 @@ namespace System.Web.DynamicData
 		[MonoTODO]
 		public string RequiredErrorMessage { get; private set; }
 
-		[MonoTODO]
-		public bool Scaffold { get; set; }
+		public bool Scaffold {
+			get {
+				if (scaffold != null)
+					return (bool)scaffold;
+				if (scaffoldReflected != null)
+					return (bool)scaffoldReflected;
+				
+				ScaffoldColumnAttribute attr = GetDataFieldAttribute <ScaffoldColumnAttribute> ();
+				if (attr != null) {
+					scaffoldReflected = attr.Scaffold;
+					return (bool)scaffoldReflected;
+				}
+
+				if (UIHint.Length > 0)
+					scaffoldReflected = true;
+				else if (IsCustomProperty || IsGenerated || IsCustomProperty)
+					scaffoldReflected = false;
+				else
+					scaffoldReflected = true;
+
+				return (bool)scaffoldReflected;
+			}
+			
+			set { scaffold = value; }
+		}
 
-		[MonoTODO]
-		public string SortExpression { get; private set; }
+		public string SortExpression {
+			get {
+				ColumnProvider provider = Provider;
+				if (provider.IsSortable)
+					return Name;
+
+				return String.Empty;
+			}
+		}
 
 		public MetaTable Table { get; private set; }
 
 		[MonoTODO]
 		public TypeCode TypeCode { get; private set; }
 
-		[MonoTODO]
-		public string UIHint { get; private set; }
+		public string UIHint {
+			get {
+				if (uiHint != null)
+					return uiHint;
 
+				UIHintAttribute attr = GetDataFieldAttribute <UIHintAttribute> ();
+				if (attr == null) {
+					uiHint = String.Empty;
+					return uiHint;
+				}
 
-		[MonoTODO]
+				uiHint = attr.UIHint;
+				return uiHint;
+			}
+		}
+
+		T GetDataFieldAttribute <T> () where T: Attribute
+		{
+			MemberInfo mi = LoadFieldInfo ();
+			if (mi == null)
+				return null;
+
+			object[] attrs = mi.GetCustomAttributes (typeof (T), true);
+			if (attrs.Length == 0)
+				return null;
+
+			return attrs [0] as T;
+		}
+
+		const BindingFlags DATA_FIELD_BINDING_FLAGS = BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy;
+		MemberInfo LoadFieldInfo ()
+		{
+			if (dataFieldInfo != null)
+				return dataFieldInfo;
+
+			MetaTable table = Table;
+			Type contextType = table.DataContextType;
+			if (contextType == null)
+				return null;
+
+			PropertyInfo pi = contextType.GetProperty (table.DataContextPropertyName, DATA_FIELD_BINDING_FLAGS);
+			if (pi == null)
+				return null;
+			contextType = pi.PropertyType;
+			if (contextType.IsGenericTypeDefinition)
+				return null;
+			if (contextType.IsGenericType) {
+				try {
+					Type[] types = contextType.GetGenericArguments ();
+					if (types.Length == 0)
+						return null;
+					contextType = types [0];
+				} catch (Exception ex) {
+					return null;
+				}
+			}
+				
+			MemberInfo[] mis = contextType.GetMember (Name, MemberTypes.Field | MemberTypes.Property, DATA_FIELD_BINDING_FLAGS);
+			if (mis.Length == 0)
+				return null;
+			
+			dataFieldInfo = mis [0];
+			return dataFieldInfo;
+		}
+		
 		public override string ToString ()
 		{
-			return base.ToString ();
+			return Name;
 		}
 	}
 }

+ 6 - 6
mcs/class/System.Web.DynamicData/System.Web.DynamicData/MetaTable.cs

@@ -59,7 +59,8 @@ namespace System.Web.DynamicData
 			Columns = new ReadOnlyCollection<MetaColumn> (l);
 
 			DisplayName = Name;
-
+			DataContextType = provider.DataModel.ContextType;
+			
 			// FIXME: fill more properties.
 		}
 
@@ -71,10 +72,10 @@ namespace System.Web.DynamicData
 		[MonoTODO]
 		public ReadOnlyCollection<MetaColumn> Columns { get; private set; }
 
-		[MonoTODO]
-		public string DataContextPropertyName { get; private set; }
+		public string DataContextPropertyName {
+			get { return Provider.Name; }	
+		}
 
-		[MonoTODO]
 		public Type DataContextType { get; private set; }
 
 		[MonoTODO]
@@ -206,10 +207,9 @@ namespace System.Web.DynamicData
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
 		public override string ToString ()
 		{
-			throw new NotImplementedException ();
+			return Name;
 		}
 
 		public bool TryGetColumn (string columnName, out MetaColumn column)

+ 4 - 0
mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources

@@ -1,3 +1,7 @@
+System.Web.DynamicData/ContextConfigurationTest.cs
+System.Web.DynamicData/DynamicDataManagerTest.cs
 System.Web.DynamicData/DynamicDataRouteTest.cs
+System.Web.DynamicData/DynamicDataExtensionsTest.cs
 System.Web.DynamicData/MetaModelTest.cs
 System.Web.DynamicData/TestStubTypes.cs
+System.Web.DynamicData.ModelProviders/TableProviderTest.cs

+ 178 - 0
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData.ModelProviders/TableProviderTest.cs

@@ -0,0 +1,178 @@
+//
+// DynamicDataRouteTest.cs
+//
+// Author:
+//      Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Web.DynamicData;
+using System.Web.DynamicData.ModelProviders;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.DynamicData.ModelProviders
+{
+	class MyDataModelProvider : DataModelProvider
+	{
+		public override object CreateContext()
+		{
+			throw new NotImplementedException();
+		}
+
+		public override ReadOnlyCollection<TableProvider> Tables
+		{
+			get { throw new NotImplementedException(); }
+		}
+	}
+
+	class MyTableProvider : TableProvider
+	{
+		public MyTableProvider(DataModelProvider model)
+			: base(model)
+		{ }
+
+		public override ReadOnlyCollection<ColumnProvider> Columns
+		{
+			get { throw new NotImplementedException(); }
+		}
+
+		public override IQueryable GetQuery(object context)
+
+		{
+			throw new NotImplementedException();
+		}
+
+		public void SetName(string name)
+		{
+			Name = name;
+		}
+	}
+
+	class MyRow
+	{
+		public string ForeignKey
+		{
+			get { return "Something"; }
+		}
+
+		public int AnotherForeignKey
+		{
+			get { return 1; }
+		}
+	}
+	
+	[TestFixture]
+	public class TableProviderTest
+	{
+		[Test]
+		public void TableProvider_Constructor()
+		{
+			var tp = new MyTableProvider(null);
+			Assert.AreEqual(null, tp.DataModel, "#A1");
+		}
+		
+		[Test]
+		public void TableProvider_Defaults()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+
+			Assert.IsTrue(tp.DataModel != null, "#A1");
+			Assert.AreEqual(typeof (MyDataModelProvider), tp.DataModel.GetType (), "#A2");
+			Assert.AreEqual(null, tp.EntityType, "#A3");
+			Assert.AreEqual(null, tp.Name, "#A4");
+			Assert.AreEqual(tp.GetType ().ToString (), tp.ToString(), "#A5");
+		}
+
+		[Test]
+		public void TableProvider_ToString()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+
+			tp.SetName ("MyName");
+			Assert.AreEqual(tp.Name, tp.ToString(), "#A1");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void TableProvider_EvaluateForeignKey()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+
+			tp.EvaluateForeignKey(null, String.Empty);
+		}
+
+		[Test]
+		[ExpectedException(typeof(ArgumentNullException))]
+		public void TableProvider_EvaluateForeignKey_2()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+			var row = new MyRow();
+
+			tp.EvaluateForeignKey(row, String.Empty);
+		}
+
+		[Test]
+		[ExpectedException(typeof(HttpException))]
+		public void TableProvider_EvaluateForeignKey_3()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+			var row = new MyRow();
+
+			tp.EvaluateForeignKey(row, "BogusName");
+		}
+
+		[Test]
+		public void TableProvider_EvaluateForeignKey_4()
+		{
+			var dmp = new MyDataModelProvider();
+			var tp = new MyTableProvider(dmp);
+			var row = new MyRow();
+
+			object o = tp.EvaluateForeignKey(row, "ForeignKey");
+			Assert.IsNotNull(o, "#A1");
+			Assert.IsTrue(o is string, "#A2");
+			Assert.AreEqual("Something", (string)o, "#A3");
+
+			o = tp.EvaluateForeignKey(row, "AnotherForeignKey");
+			Assert.IsNotNull(o, "#B1");
+			Assert.IsTrue(o is int, "#B2");
+			Assert.AreEqual(1, (int)o, "#B3");
+		}
+	}
+}
+

+ 4 - 0
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/ChangeLog

@@ -1,3 +1,7 @@
+2009-04-23  Marek Habersack  <[email protected]>
+
+	* ContextConfigurationTest.cs: added
+
 2008-11-10  Raja R Harinath  <[email protected]>
 
 	* MetaModelTest.cs: Remove 'using System.ComponentModel' to avoid

+ 54 - 0
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/ContextConfigurationTest.cs

@@ -0,0 +1,54 @@
+//
+// DynamicDataRouteTest.cs
+//
+// Author:
+//      Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Web;
+using System.Web.DynamicData;
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.DynamicData
+{
+	[TestFixture]
+	public class ContextConfigurationTests
+	{
+		[Test]
+		public void DefaultValues()
+		{
+			var ctx = new ContextConfiguration();
+			var func = ctx.MetadataProviderFactory;
+
+			Assert.IsTrue(func != null, "#A1");
+			Assert.AreEqual(typeof (Func <Type, TypeDescriptionProvider>), func.GetType (), "#A2");
+			Assert.AreEqual(false, ctx.ScaffoldAllTables, "#A3");
+			Assert.AreEqual(typeof(AssociatedMetadataTypeTypeDescriptionProvider), func(typeof(string)).GetType (), "#A4");
+		}
+	}
+}

+ 153 - 0
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataExtensionsTest.cs

@@ -0,0 +1,153 @@
+//
+// DynamicDataRouteTest.cs
+//
+// Author:
+//      Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Web.DynamicData;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.DynamicData
+{
+	class FakeWorkerRequest : HttpWorkerRequest
+	{
+		public override string GetUriPath()
+		{
+			return "/";
+		}
+
+		public override string GetQueryString()
+		{
+			return "GetQueryString";
+		}
+
+		public override string GetRawUrl()
+		{
+			return "GetRawUrl";
+		}
+
+		public override string GetHttpVerbName()
+		{
+			return "GetVerbName";
+		}
+
+		public override string GetHttpVersion()
+		{
+			return "GetHttpVersion";
+		}
+
+		public override string GetRemoteAddress()
+		{
+			return "__GetRemoteAddress";
+		}
+
+		public override int GetRemotePort()
+		{
+			return 1010;
+		}
+
+		public override string GetLocalAddress()
+		{
+			return "GetLocalAddress";
+		}
+
+		public override int GetLocalPort()
+		{
+			return 2020;
+		}
+
+		public override void SendStatus(int s, string x)
+		{
+		}
+
+		public override void SendKnownResponseHeader(int x, string j)
+		{
+		}
+
+		public override void SendUnknownResponseHeader(string a, string b)
+		{
+		}
+
+		public override void SendResponseFromMemory(byte[] arr, int x)
+		{
+		}
+
+		public override void SendResponseFromFile(string a, long b, long c)
+		{
+		}
+
+		public override void SendResponseFromFile(IntPtr a, long b, long c)
+		{
+		}
+
+		public override void FlushResponse(bool x)
+		{
+		}
+
+		public override void EndOfRequest()
+		{
+		}
+	}
+	
+	[TestFixture]
+	public class DynamicDataExtensionsTest
+	{
+		[Test]
+		public void DynamicDataExtensions_GetTable_Test ()
+		{
+			IDynamicDataSource dds = null;
+
+			dds.GetTable ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void DynamicDataExtensions_GetTable_Test2()
+		{
+			HttpContext.Current = new HttpContext(new FakeWorkerRequest());
+			var dds = new LinqDataSource();
+			dds.TableName = "test";
+
+			dds.GetTable();
+		}
+
+		[Test]
+		[ExpectedException(typeof(InvalidOperationException))]
+		public void DynamicDataExtensions_GetTable_Test3()
+		{
+			HttpContext.Current = new HttpContext(new FakeWorkerRequest());
+			var dds = new LinqDataSource();
+
+			dds.GetTable();
+		}
+	}
+}

+ 1023 - 0
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataManagerTest.cs

@@ -0,0 +1,1023 @@
+//
+// DynamicDataRouteTest.cs
+//
+// Author:
+//      Marek Habersack <[email protected]>
+//
+// Copyright (C) 2009 Novell Inc. http://novell.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Web.DynamicData;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using NUnit.Framework;
+
+namespace MonoTests.System.Web.DynamicData
+{
+	class MyTemplate : WebControl, ITemplate
+	{
+		public MyTemplate()
+		{
+			ID = "MyTemplate";
+		}
+
+#region ITemplate Members
+		void ITemplate.InstantiateIn(Control container)
+		{
+			foreach (Control c in Controls)
+				container.Controls.Add(c);
+		}
+#endregion
+	}
+
+	class MyBaseDataBoundControl : BaseDataBoundControl
+	{
+		protected override void PerformSelect()
+		{
+			// no-op
+		}
+
+		protected override void ValidateDataSource(object dataSource)
+		{
+			// no-op
+		}
+	}
+
+	class MyDataBoundControl : DataBoundControl
+	{ }
+
+	class MyDynamicDataManager : DynamicDataManager
+	{
+		public void DoLoad()
+		{
+			OnLoad(EventArgs.Empty);
+		}
+	}
+
+	[TestFixture]
+	public class DynamicDataManagerTests
+	{
+		[Test]
+		public void DefaultValues()
+		{
+			var ddm = new DynamicDataManager();
+
+			Assert.AreEqual(true, ddm.Visible, "#A1");
+			Assert.AreEqual(false, ddm.AutoLoadForeignKeys, "#A2");
+		}
+
+		[Test]
+		[ExpectedException (typeof (NotImplementedException))]
+		public void VisibleSet()
+		{
+			var ddm = new DynamicDataManager();
+
+			ddm.Visible = false;
+		}
+
+		[Test]
+		[ExpectedException (typeof (NullReferenceException))]
+		public void RegisterControl_NullControl()
+		{
+			var ddm = new DynamicDataManager();
+			ddm.RegisterControl(null);
+		}
+
+		[Test]
+		[ExpectedException(typeof(NullReferenceException))]
+		public void RegisterControl_NullControl2()
+		{
+			var ddm = new DynamicDataManager();
+			ddm.RegisterControl(null, false);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void RegisterControl_ControlIsNotDataBoundControl()
+		{
+			var ddm = new DynamicDataManager();
+			var control = new MyBaseDataBoundControl ();
+			ddm.RegisterControl(control);
+		}
+
+		[Test]
+		public void RegisterControl_ControlIsDataBoundControl()
+		{
+			var ddm = new DynamicDataManager();
+			var control = new MyDataBoundControl();
+			ddm.RegisterControl(control);
+		}
+
+		[Test]
+		public void RegisterControl_ControlIsDataBoundControl2()
+		{
+			var ddm = new DynamicDataManager();
+			var control = new MyDataBoundControl();
+			ddm.RegisterControl(control, false);
+			ddm.RegisterControl(control, true);
+		}
+
+#region Supported controls
+		// Checks for which controls are supported
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_AdRotator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (AdRotator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_BulletedList_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (BulletedList)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CheckBoxList_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CheckBoxList)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_DetailsView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (DetailsView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_DropDownList_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (DropDownList)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_FormView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (FormView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_GridView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (GridView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ListBox_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ListBox)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_RadioButtonList_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (RadioButtonList)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Repeater_Test2()
+		{
+			var ddm = new DynamicDataManager();
+			var control = Activator.CreateInstance(typeof(Repeater)) as Control;
+			var page = new Page();
+			page.Controls.Add(control);
+			ddm.RegisterControl(control);
+		}
+		
+		[Test]
+		[ExpectedException (typeof (HttpException))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Repeater_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Repeater)) as Control;
+			ddm.RegisterControl (control);
+		}
+#endregion
+		
+#region Unsupported controls
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_Control_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Control)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_DesignerDataBoundLiteralControl_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (DesignerDataBoundLiteralControl)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_Page_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Page)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlForm_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlForm)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_LiteralControl_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (LiteralControl)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_UserControl_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (UserControl)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_MasterPage_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (MasterPage)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlAnchor_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlAnchor)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlGenericControl_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlGenericControl)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlHead_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlHead)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlImage_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlImage)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputCheckBox_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputCheckBox)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputFile_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputFile)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputHidden_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputHidden)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputImage_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputImage)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputText_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputText)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputPassword_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputPassword)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputRadioButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputRadioButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputReset_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputReset)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlInputSubmit_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlInputSubmit)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlLink_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlLink)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlMeta_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlMeta)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlSelect_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlSelect)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlTable_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlTable)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlTableCell_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlTableCell)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlTableRow_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlTableRow)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlTextArea_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlTextArea)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_HtmlControls_HtmlTitle_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HtmlTitle)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_SqlDataSource_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (SqlDataSource)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_AccessDataSource_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (AccessDataSource)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Label_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Label)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Button_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Button)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Calendar_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Calendar)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ChangePassword_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ChangePassword)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TableRow_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TableRow)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CheckBox_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CheckBox)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Table_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Table)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CompareValidator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CompareValidator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_View_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (View)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TemplatedWizardStep_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TemplatedWizardStep)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CompleteWizardStep_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CompleteWizardStep)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Content_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Content)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ContentPlaceHolder_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ContentPlaceHolder)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Wizard_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Wizard)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TableCell_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TableCell)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CreateUserWizard_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CreateUserWizard)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CreateUserWizardStep_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CreateUserWizardStep)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_CustomValidator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (CustomValidator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Image_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Image)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ImageButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ImageButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_LinkButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (LinkButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_DataGrid_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (DataGrid)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_DataList_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (DataList)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_FileUpload_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (FileUpload)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_HiddenField_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HiddenField)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_HyperLink_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (HyperLink)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ImageMap_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ImageMap)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Literal_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Literal)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Localize_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Localize)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Login_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Login)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_LoginName_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (LoginName)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_LoginStatus_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (LoginStatus)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_LoginView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (LoginView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Menu_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Menu)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_MultiView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (MultiView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ObjectDataSource_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ObjectDataSource)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Panel_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Panel)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_PasswordRecovery_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (PasswordRecovery)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_PlaceHolder_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (PlaceHolder)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_RadioButton_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (RadioButton)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_RangeValidator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (RangeValidator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_RegularExpressionValidator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (RegularExpressionValidator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_RequiredFieldValidator_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (RequiredFieldValidator)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_SiteMapDataSource_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (SiteMapDataSource)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_SiteMapPath_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (SiteMapPath)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Substitution_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Substitution)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TableFooterRow_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TableFooterRow)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TableHeaderCell_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TableHeaderCell)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TableHeaderRow_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TableHeaderRow)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TextBox_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TextBox)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_TreeView_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (TreeView)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_ValidationSummary_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (ValidationSummary)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_WizardStep_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (WizardStep)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_Xml_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (Xml)) as Control;
+			ddm.RegisterControl (control);
+		}
+
+		[Test]
+		[ExpectedException (typeof (Exception))]
+		public void DynamicManagerRegisterControl_System_Web_UI_WebControls_XmlDataSource_Test ()
+		{
+			var ddm = new DynamicDataManager ();
+			var control = Activator.CreateInstance (typeof (XmlDataSource)) as Control;
+			ddm.RegisterControl (control);
+		}
+#endregion
+	}	
+}

+ 1 - 0
mcs/class/System.Web/Assembly/AssemblyInfo.cs

@@ -68,6 +68,7 @@ using System.Web.UI;
 [assembly: InternalsVisibleTo ("System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
 [assembly: InternalsVisibleTo ("System.Web_test_net_2_0, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
 [assembly: InternalsVisibleTo ("System.Web.Extensions_test_net_2_0, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
+[assembly: InternalsVisibleTo ("System.Web.DynamicData, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
 #endif
 #endif
 

+ 5 - 0
mcs/class/System.Web/Assembly/ChangeLog

@@ -1,3 +1,8 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* AssemblyInfo.cs: added InternalsVisibleTo for
+	System.Web.DynamicData
+
 2009-01-20  Marek Habersack  <[email protected]>
 
 	* AssemblyInfo.cs: made internals visible to

+ 5 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,8 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* DataBoundControl.cs: added InternalGetDataSource method, used by
+	DynamicData
+
 2009-04-28  Marek Habersack  <[email protected]>
 
 	* GridView.cs: implemented ColumnsGenerator and enabled its use in

+ 4 - 0
mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs

@@ -62,6 +62,10 @@ namespace System.Web.UI.WebControls {
 		{
 		}
 		
+		internal IDataSource InternalGetDataSource ()
+		{
+			return GetDataSource ();
+		}
 		
 		protected virtual IDataSource GetDataSource ()
 		{

+ 5 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,8 @@
+2009-04-29  Marek Habersack  <[email protected]>
+
+	* DataBinder.cs: GetPropertyValue must throw also if propName is
+	empty.
+
 2009-04-24  Marek Habersack  <[email protected]>
 
 	* TemplateParser.cs: PageParserFilter.Initialize now takes just

+ 1 - 1
mcs/class/System.Web/System.Web.UI/DataBinder.cs

@@ -179,7 +179,7 @@ namespace System.Web.UI {
 		{
 			if (container == null)
 				throw new ArgumentNullException ("container");
-			if (propName == null)
+			if (propName == null || propName.Length == 0)
 				throw new ArgumentNullException ("propName");
 
 			PropertyDescriptor prop = TypeDescriptor.GetProperties (container).Find (propName, true);