Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Ximian, Inc. http://www.ximian.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.Reflection;
using System.Resources;
using System.Security;
using System.Security.Permissions;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about the System.Web.DynamicData assembly
// v3.5 Assembly
[assembly: AssemblyTitle ("System.Web.DynamicData.dll")]
[assembly: AssemblyDescription ("System.Web.DynamicData.dll")]
[assembly: AssemblyDefaultAlias ("System.Web.DynamicData.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
[assembly: ComVisible (false)]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
// FIXME: We get collisions with this internalsVisibleTo because of Consts.cs and MonoTodo
//[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]

View File

@@ -0,0 +1,3 @@
2008-10-14 Atsushi Enomoto <atsushi@ximian.com>
* AssemblyInfo.cs : initial checkin.

View File

@@ -0,0 +1,103 @@
2009-12-18 Marek Habersack <mhabersack@novell.com>
* Makefile (EXTRA_DISTFILES): include test resources in
dist. Fixes bug #564987
2009-09-18 Marek Habersack <mhabersack@novell.com>
* Makefile (TEST_RESOURCE_FILES): added
Test/WebPages/ListView_DynamicControl_10.aspx,
Test/WebPages/ListView_DynamicControl_10.aspx.cs
2009-09-15 Marek Habersack <mhabersack@novell.com>
* Makefile (TEST_RESOURCE_FILES): added
Test/WebPages/ListView_DynamicControl_09.aspx and
Test/WebPages/ListView_DynamicControl_09.aspx.cs
2009-09-10 Marek Habersack <mhabersack@novell.com>
* Makefile (TEST_RESOURCE_FILES): added
Test/WebPages/ListView_DynamicControl_05.aspx
Test/WebPages/ListView_DynamicControl_05.aspx.cs
Test/WebPages/ListView_DynamicControl_06.aspx
Test/WebPages/ListView_DynamicControl_06.aspx.cs
Test/WebPages/ListView_DynamicControl_07.aspx
Test/WebPages/ListView_DynamicControl_07.aspx.cs
Test/WebPages/ListView_DynamicControl_08.aspx
Test/WebPages/ListView_DynamicControl_08.aspx.cs
2009-07-06 Marek Habersack <mhabersack@novell.com>
* Makefile (TEST_RESOURCE_FILES): added new test resources
2009-07-06 Raja R Harinath <harinath@hurrynot.org>
* Makefile (TEST_MCS_FLAGS): Reference SystemWebTestShim.
2009-07-03 Marek Habersack <mhabersack@novell.com>
* Makefile: added more resources to the test assembly
2009-06-18 Marek Habersack <mhabersack@novell.com>
* Test/DataSource/DynamicDataColumn.cs: added Sortable property.
2009-06-17 Marek Habersack <mhabersack@novell.com>
* System.Web.DynamicData_test.dll.sources: added
Common/FooNoScaffold.cs, Common/TestDataContext2.cs,
ModelProviders/DynamicDataStringLengthAttribute.cs
2009-06-12 Marek Habersack <mhabersack@novell.com>
* Test/DataSource/DynamicDataColumn.cs: added table association
members.
2009-06-10 Marek Habersack <mhabersack@novell.com>
* System.Web.DynamicData_test.dll.sources: added
Common/FooDisplayName.cs
Common/FooDisplayNameEmptyName.cs
Common/FooSettableDefaults.cs
2009-06-09 Marek Habersack <mhabersack@novell.com>
* System.Web.DynamicData_test.dll.sources: added
Common/FooNoDefaultsWithPrimaryKey.cs
Common/FooNoPrimaryColumns.cs
2009-04-29 Marek Habersack <mhabersack@novell.com>
* 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 <mhabersack@novell.com>
* 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 <atsushi@ximian.com>
* Makefile : added -r:System.Data.
* System.Web.DynamicData_test.dll.sources : new file.
2008-10-14 Atsushi Enomoto <atsushi@ximian.com>
* Makefile, System.Web.DynamicData.dll.sources : initial checkin.

View File

@@ -0,0 +1,197 @@
thisdir = class/System.Web.DynamicData
SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Web.DynamicData.dll
LIB_MCS_FLAGS = \
/r:System.dll \
/r:System.Core.dll \
/r:System.ComponentModel.DataAnnotations.dll \
/r:System.Data.dll \
/r:System.Data.Linq.dll \
/r:System.Drawing.dll \
/r:System.Web.dll \
/r:System.Web.Extensions.dll \
/r:System.Web.Abstractions.dll \
/r:System.Web.Routing.dll
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
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
endif
# Use genresources.sh to generate the list below
TEST_RESOURCE_FILES = \
Test/WebPages/DynamicData/Content/FilterUserControl.ascx,MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx \
Test/WebPages/DynamicData/Content/FilterUserControl.ascx.cs,MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx.cs \
Test/WebPages/DynamicData/Content/GridViewPager.ascx,MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx \
Test/WebPages/DynamicData/Content/GridViewPager.ascx.cs,MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx.cs \
Test/WebPages/DynamicData/Content/Images/Back.gif,MonoTests.WebPages.DynamicData.Content.Images.Back.gif \
Test/WebPages/DynamicData/Content/Images/header_back.gif,MonoTests.WebPages.DynamicData.Content.Images.header_back.gif \
Test/WebPages/DynamicData/Content/Images/PgFirst.gif,MonoTests.WebPages.DynamicData.Content.Images.PgFirst.gif \
Test/WebPages/DynamicData/Content/Images/PgLast.gif,MonoTests.WebPages.DynamicData.Content.Images.PgLast.gif \
Test/WebPages/DynamicData/Content/Images/PgNext.gif,MonoTests.WebPages.DynamicData.Content.Images.PgNext.gif \
Test/WebPages/DynamicData/Content/Images/PgPrev.gif,MonoTests.WebPages.DynamicData.Content.Images.PgPrev.gif \
Test/WebPages/DynamicData/Content/Images/plus.gif,MonoTests.WebPages.DynamicData.Content.Images.plus.gif \
Test/WebPages/DynamicData/FieldTemplates/Boolean.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx \
Test/WebPages/DynamicData/FieldTemplates/Boolean.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Boolean_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/Boolean_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Children.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx \
Test/WebPages/DynamicData/FieldTemplates/Children.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/CustomColor.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx \
Test/WebPages/DynamicData/FieldTemplates/CustomColor.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/CustomFieldTemplate.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx \
Test/WebPages/DynamicData/FieldTemplates/CustomFieldTemplate.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/DateTime.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx \
Test/WebPages/DynamicData/FieldTemplates/DateTime.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/DateTime_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/DateTime_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Decimal_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/Decimal_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/ForeignKey.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx \
Test/WebPages/DynamicData/FieldTemplates/ForeignKey.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/ForeignKey_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/ForeignKey_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Integer_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/Integer_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/MultilineText_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/MultilineText_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/MyCustomUIHintTemplate_Text.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx \
Test/WebPages/DynamicData/FieldTemplates/MyCustomUIHintTemplate_Text.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Boolean.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Boolean.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Byte.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Byte[].ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Byte.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Byte[].ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Char.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Char.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/FooEmpty.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/FooEmpty.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/ICollection.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/ICollection.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int16.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int16.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int32.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int32.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int64.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Int64.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/MonoTests.Common.FooEmpty.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/MonoTests.Common.FooEmpty.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Object.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/Object.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/SByte.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/SByte.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/String.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/String.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Boolean.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Boolean.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Byte.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Byte[].ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Byte.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Byte[].ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Char.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Char.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Collections.Generic.List\`1[System.String].ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List\`1[System.String].ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Collections.Generic.List\`1[System.String].ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List\`1[System.String].ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Collections.ICollection.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Collections.ICollection.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int16.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int16.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int32.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int32.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int64.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Int64.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Object.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.Object.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.SByte.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.SByte.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.String.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.String.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt16.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt16.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt32.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt32.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt64.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/System.UInt64.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt16.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt16.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt32.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt32.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt64.ascx,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx \
Test/WebPages/DynamicData/FieldTemplates_NonDefault/UInt64.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/PlainControlTemplate.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx \
Test/WebPages/DynamicData/FieldTemplates/PlainControlTemplate.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Text.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx \
Test/WebPages/DynamicData/FieldTemplates/Text.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx.cs \
Test/WebPages/DynamicData/FieldTemplates/Text_Edit.ascx,MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx \
Test/WebPages/DynamicData/FieldTemplates/Text_Edit.ascx.cs,MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx.cs \
Test/WebPages/DynamicData/PageTemplates/Details.aspx,MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx \
Test/WebPages/DynamicData/PageTemplates/Details.aspx.cs,MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx.cs \
Test/WebPages/DynamicData/PageTemplates/Edit.aspx,MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx \
Test/WebPages/DynamicData/PageTemplates/Edit.aspx.cs,MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx.cs \
Test/WebPages/DynamicData/PageTemplates/Insert.aspx,MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx \
Test/WebPages/DynamicData/PageTemplates/Insert.aspx.cs,MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx.cs \
Test/WebPages/DynamicData/PageTemplates/List.aspx,MonoTests.WebPages.DynamicData.PageTemplates.List.aspx \
Test/WebPages/DynamicData/PageTemplates/List.aspx.cs,MonoTests.WebPages.DynamicData.PageTemplates.List.aspx.cs \
Test/WebPages/DynamicData/PageTemplates/ListDetails.aspx,MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx \
Test/WebPages/DynamicData/PageTemplates/ListDetails.aspx.cs,MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx.cs \
Test/WebPages/DynamicData/web.config,MonoTests.WebPages.DynamicData.web.config \
Test/WebPages/Global.asax,MonoTests.WebPages.Global.asax \
Test/WebPages/ListView_DynamicControl_01.aspx,MonoTests.WebPages.ListView_DynamicControl_01.aspx \
Test/WebPages/ListView_DynamicControl_01.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_01.aspx.cs \
Test/WebPages/ListView_DynamicControl_02.aspx,MonoTests.WebPages.ListView_DynamicControl_02.aspx \
Test/WebPages/ListView_DynamicControl_02.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_02.aspx.cs \
Test/WebPages/ListView_DynamicControl_03.aspx,MonoTests.WebPages.ListView_DynamicControl_03.aspx \
Test/WebPages/ListView_DynamicControl_03.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_03.aspx.cs \
Test/WebPages/ListView_DynamicControl_04.aspx,MonoTests.WebPages.ListView_DynamicControl_04.aspx \
Test/WebPages/ListView_DynamicControl_04.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_04.aspx.cs \
Test/WebPages/ListView_DynamicControl_05.aspx,MonoTests.WebPages.ListView_DynamicControl_05.aspx \
Test/WebPages/ListView_DynamicControl_05.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_05.aspx.cs \
Test/WebPages/ListView_DynamicControl_06.aspx,MonoTests.WebPages.ListView_DynamicControl_06.aspx \
Test/WebPages/ListView_DynamicControl_06.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_06.aspx.cs \
Test/WebPages/ListView_DynamicControl_07.aspx,MonoTests.WebPages.ListView_DynamicControl_07.aspx \
Test/WebPages/ListView_DynamicControl_07.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_07.aspx.cs \
Test/WebPages/ListView_DynamicControl_08.aspx,MonoTests.WebPages.ListView_DynamicControl_08.aspx \
Test/WebPages/ListView_DynamicControl_08.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_08.aspx.cs \
Test/WebPages/ListView_DynamicControl_09.aspx,MonoTests.WebPages.ListView_DynamicControl_09.aspx \
Test/WebPages/ListView_DynamicControl_09.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_09.aspx.cs \
Test/WebPages/ListView_DynamicControl_10.aspx,MonoTests.WebPages.ListView_DynamicControl_10.aspx \
Test/WebPages/ListView_DynamicControl_10.aspx.cs,MonoTests.WebPages.ListView_DynamicControl_10.aspx.cs \
Test/WebPages/DynamicValidator_01.aspx,MonoTests.WebPages.DynamicValidator_01.aspx \
Test/WebPages/DynamicValidator_01.aspx.cs,MonoTests.WebPages.DynamicValidator_01.aspx.cs \
Test/WebPages/DynamicValidator_02.aspx,MonoTests.WebPages.DynamicValidator_02.aspx \
Test/WebPages/DynamicValidator_02.aspx.cs,MonoTests.WebPages.DynamicValidator_02.aspx.cs \
Test/WebPages/Site.css,MonoTests.WebPages.Site.css \
Test/WebPages/Site.master,MonoTests.WebPages.Site.master \
Test/WebPages/Site.master.cs,MonoTests.WebPages.Site.master.cs \
Test/WebPages/web.config.2.0,MonoTests.WebPages.web.config.2.0 \
Test/WebPages/web.config.4.0,MonoTests.WebPages.web.config.4.0 \
Test/WebPages/web.config.4.5,MonoTests.WebPages.web.config.4.5
NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.ComponentModel.DataAnnotations.dll -r:System.Configuration.dll \
$(NUNIT_RESOURCE_FILES:%=/resource:%) -r:SystemWebTestShim.dll -r:System.Xml.dll
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
TEST_MCS_FLAGS += -r:System.Web.ApplicationServices.dll
endif
EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1))
# This is a .NET 3.5+ assembly
VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.Web.DynamicData.dll
NO_INSTALL = yes
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
endif
include ../../build/library.make

View File

@@ -0,0 +1,42 @@
//
// AssociationDirection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 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.Web.DynamicData.ModelProviders
{
public enum AssociationDirection
{
OneToOne,
OneToMany,
ManyToOne,
ManyToMany
}
}

View File

@@ -0,0 +1,66 @@
//
// AssociationProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 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.Security.Permissions;
namespace System.Web.DynamicData.ModelProviders
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class AssociationProvider
{
[MonoTODO]
public virtual AssociationDirection Direction { get; protected set; }
[MonoTODO]
public virtual ReadOnlyCollection<string> ForeignKeyNames { get; protected set; }
[MonoTODO]
public virtual ColumnProvider FromColumn { get; protected set; }
[MonoTODO]
public virtual bool IsPrimaryKeyInThisTable { get; protected set; }
[MonoTODO]
public virtual ColumnProvider ToColumn { get; protected set; }
[MonoTODO]
public virtual TableProvider ToTable { get; protected set; }
[MonoTODO]
public virtual string GetSortExpression (ColumnProvider sortColumn)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,24 @@
2009-04-29 Marek Habersack <mhabersack@novell.com>
* 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 <atsushi@ximian.com>
* ColumnProvider.cs, TableProvider.cs : implemented constructors.
* DLinqDataModelProviders.cs : new, DLinq-based implementation.
2008-10-14 Atsushi Enomoto <atsushi@ximian.com>
*.cs : initial checkin. stubs.

View File

@@ -0,0 +1,90 @@
//
// ColumnProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 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.Reflection;
using System.Security.Permissions;
namespace System.Web.DynamicData.ModelProviders
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class ColumnProvider
{
protected ColumnProvider (TableProvider table)
{
if (table == null)
throw new ArgumentNullException ("table");
this.Table = table;
}
[MonoTODO]
public virtual AssociationProvider Association { get; protected set; }
[MonoTODO]
public virtual Type ColumnType { get; protected set; }
[MonoTODO]
public virtual PropertyInfo EntityTypeProperty { get; protected set; }
[MonoTODO]
public virtual bool IsCustomProperty { get; protected set; }
[MonoTODO]
public virtual bool IsForeignKeyComponent { get; protected set; }
[MonoTODO]
public virtual bool IsGenerated { get; protected set; }
[MonoTODO]
public virtual bool IsPrimaryKey { get; protected set; }
[MonoTODO]
public virtual bool IsSortable { get; protected set; }
[MonoTODO]
public virtual int MaxLength { get; protected set; }
[MonoTODO]
public virtual string Name { get; protected set; }
[MonoTODO]
public virtual bool Nullable { get; protected set; }
[MonoTODO]
public TableProvider Table { get; private set; }
[MonoTODO]
public override string ToString ()
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,50 @@
//
// DLinqAssociationProvider.cs
//
// Author:
// Marek Habersack <mhabersack@novell.com>
//
// 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)
{
}
}
}

View File

@@ -0,0 +1,65 @@
//
// DLinqColumnProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// 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");
// FIXME: fill more
Name = meta.Name;
Nullable = meta.CanBeNull;
}
[MonoTODO]
public override string ToString ()
{
return base.ToString ();
}
}
}

View File

@@ -0,0 +1,79 @@
//
// DLinqDataModelProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// 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 DLinqDataModelProvider : DataModelProvider
{
Func<object> factory;
DMetaModel model;
public DLinqDataModelProvider (Func<object> factory)
{
this.factory = factory;
Type type = CreateContext ().GetType ();
if (!typeof (DataContext).IsAssignableFrom (type))
throw new ArgumentException (String.Format ("Type '{0}' is not supported as data context factory", type));
this.factory = factory;
model = new AttributeMappingSource ().GetModel (type);
ContextType = model.ContextType;
var l = new List<TableProvider> ();
foreach (var m in model.GetTables ())
l.Add (new DLinqTableProvider (this, m));
tables = new ReadOnlyCollection<TableProvider> (l);
}
ReadOnlyCollection<TableProvider> tables;
public override ReadOnlyCollection<TableProvider> Tables {
get { return tables; }
}
public override object CreateContext ()
{
return factory ();
}
}
}

View File

@@ -0,0 +1,77 @@
//
// DLinqTableProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// 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);
}
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 ();
}
}
}

View File

@@ -0,0 +1,49 @@
//
// DataModelProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 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.Security.Permissions;
namespace System.Web.DynamicData.ModelProviders
{
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class DataModelProvider
{
[MonoTODO]
public virtual Type ContextType { get; protected set; }
public abstract ReadOnlyCollection<TableProvider> Tables { get; }
public abstract object CreateContext ();
}
}

View File

@@ -0,0 +1,72 @@
//
// TableProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
// Marek Habersack <mhabersack@novell.com>
//
// 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.Linq;
using System.Security.Permissions;
using System.Web.UI;
namespace System.Web.DynamicData.ModelProviders
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class TableProvider
{
protected TableProvider (DataModelProvider model)
{
DataModel = model;
}
public abstract ReadOnlyCollection<ColumnProvider> Columns { get; }
public DataModelProvider DataModel { get; private set; }
public virtual Type EntityType { get; protected set; }
public virtual string Name { get; protected set; }
public virtual object EvaluateForeignKey (object row, string foreignKeyName)
{
return DataBinder.GetPropertyValue (row, foreignKeyName);
}
public abstract IQueryable GetQuery (object context);
public override string ToString ()
{
string name = Name;
if (String.IsNullOrEmpty (name))
return base.ToString ();
return name;
}
}
}

View File

@@ -0,0 +1,40 @@
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
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/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
System.Web.DynamicData/DynamicControl.cs
System.Web.DynamicData/DynamicControlParameter.cs
System.Web.DynamicData/DynamicDataExtensions.cs
System.Web.DynamicData/DynamicDataManager.cs
System.Web.DynamicData/DynamicDataRoute.cs
System.Web.DynamicData/DynamicDataRouteHandler.cs
System.Web.DynamicData/DynamicField.cs
System.Web.DynamicData/DynamicQueryStringParameter.cs
System.Web.DynamicData/DynamicValidator.cs
System.Web.DynamicData/FieldTemplateFactory.cs
System.Web.DynamicData/FieldTemplateUserControl.cs
System.Web.DynamicData/FilterRepeater.cs
System.Web.DynamicData/FilterUserControlBase.cs
System.Web.DynamicData/IControlParameterTarget.cs
System.Web.DynamicData/IFieldFormattingOptions.cs
System.Web.DynamicData/IFieldTemplate.cs
System.Web.DynamicData/IFieldTemplateFactory.cs
System.Web.DynamicData/IFieldTemplateHost.cs
System.Web.DynamicData/IWhereParametersProvider.cs
System.Web.DynamicData/MetaChildrenColumn.cs
System.Web.DynamicData/MetaColumn.cs
System.Web.DynamicData/MetaForeignKeyColumn.cs
System.Web.DynamicData/MetaModel.cs
System.Web.DynamicData/MetaTable.cs
System.Web.DynamicData/PageAction.cs
System.Web.DynamicData/TableNameAttribute.cs

View File

@@ -0,0 +1,222 @@
2009-10-02 Marek Habersack <mhabersack@novell.com>
* DynamicValidator.cs: initial implementation
* DynamicDataManager.cs: implemented OnLoad.
Better implementation of RegisterControl
* DynamicDataExtensions.cs: implemented FindDataSourceControl.
2009-09-18 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: implemented Init - calls Init on all the columns
present in this instance.
* MetaModel.cs: constructor initializes FieldTemplateFactory after
it is instantiated.
RegisterContextCore first registers the context type, then creates
tables and finally calls Init on all the tables.
* MetaColumn.cs: added internal Init method - called by MetaModel
after context is registered and all tables are created and
registered.
* MetaChildrenColumn.cs: implemented ChildTable,
ColumnInOtherTable, GetChildrenListPath, GetChildrenPath and added
an internal Init method override. MonoTODO attributes stay until I
write tests for the class.
* FieldTemplateUserControl.cs: implemented ChildrenColumn,
ChildrenPath, Column, ForeignKeyColumn, ForeignKeyPath,
MetadataAttributes, Mode, Row, Table, SetHost
* FieldTemplateFactory.cs: GetFieldTemplateVirtualPath fixes
* DynamicControl.cs: implemented ApplyFormatInEditMode,
ConvertEmptyStringToNull, DataField, DataFormatString, HtmlEncode,
FormattingOptions, NullDisplayText, UIHint, OnInit, Render.
2009-09-15 Marek Habersack <mhabersack@novell.com>
* MetaColumn.cs: DataTypeAttribtue created automatically for
string columns, must be of type MultilineText for long strings.
* FieldTemplateFactory.cs: implemented BuildVirtualPath,
CreateFieldTemplate, GetFieldTemplateVirtualPath, PreprocessMode
and fixed implementation of TemplateFolderVirtualPath.
2009-09-10 Marek Habersack <mhabersack@novell.com>
* DynamicControl.cs: implemented several properties.
Added code for ResolveColumn method, called from OnInit
2009-07-14 Marek Habersack <mhabersack@novell.com>
* FieldTemplateFactory.cs: implemented TemplateFolderVirtualPath
2009-06-27 Marek Habersack <mhabersack@novell.com>
* DynamicDataExtensions.cs: implemented ConvertEditedValue
* MetaModel.cs: implemented DynamicDataFolderVirtualPath
* DynamicDataRouteHandler.cs: implemented SetRequestMetaTable,
GetCustomPageVirtualPath, GetScaffoldPageVirtualPath and
guessed at implementation of CreateHandler.
2009-06-26 Marek Habersack <mhabersack@novell.com>
* MetaModel.cs: RegisterContextCore preserves already registered
tables.
* DynamicDataRouteHandler.cs: GetRequestContext must not retrieve
route data from the routes collection (if the matching route
happened to be an instance of DynamicDataRoute it would initialize
its RouteHandler's Model property, which is not correct, according
to tests). Instead a new RouteData instance is created each time
we don't find any cached context.
* DynamicDataRoute.cs: the associated route handler is set its
Model property when we initialize for the first time.
GetRouteData checks whether route data returned by base class
relates to a table which exists in the current context. If no such
table exists, null is returned.
2009-06-25 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: Fixes to make tests succeed.
* MetaModel.cs: added the GetDataFieldAttributes method for
retrieving attributes associated with data type/field.
Fixes to make tests succeed.
* MetaColumn.cs: refactoring - use
MetaModel.GetDataFieldAttributes instead of the local version.
* DynamicDataRouteHandler.cs: implemented GetRequestContext,
GetRequestMetaTable.
* DynamicDataRoute.cs: when the Action and Table properties are
set before one of GetVirtualPath or GetRouteData methods are
called for the first time, a check is made whether the Defaults
collection exists and whether it contains entries for Action and
Table. Initialization code makes sure those entries are inserted
into the dictionary in those cases.
2009-06-23 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: constructor now takes ContextConfiguration instead
of a boolean and uses the config to determine value of the
ScaffoldAllTables property. Also, if context config is present,
makes sure to register the associated type description provider
(if any) with TypeDescriptor.
* MetaModel.cs: no longer uses local cache for description
providers. Uses TypeDescriptor.{Add,Get}Provider now.
* MetaColumn.cs: fixed Scaffold to match tests - IsGenerated and
IsCustomProperty take precedence over Table.ScaffoldAllTables.
GetDataFieldAttribute doesn't use AttributeCollection indexer, as
the latter would create a default instance of the requested
attribute, which is not what we want here.
2009-06-17 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: fixed Scaffold implementation.
Added internal ScaffoldAllTables property.
* MetaColumn.cs: fixed TypeCode, MaxLength, Scaffold, UIHint
implementations.
Implemented IsLongString, IsBinaryData, IsReadOnly,
NullDisplayText, RequiredErrorMessage
2009-06-16 Marek Habersack <mhabersack@novell.com>
* DynamicDataManager.cs, DynamicDataExtensions.cs: use new
DataBoundControl.DataSourceObject instead of
InternalGetDataSource.
2009-06-15 Marek Habersack <mhabersack@novell.com>
* MetaColumn.cs: implemented ApplyFormatInEditMode, Attributes,
ConvertEmptyStringToNull, DataFormatString, DataTypeAttribute,
DefaultValue, Description, DisplayName, IsRequired,
IsFloatingPoint, IsInteger, IsString, TypeCode
* MetaTable.cs: use MetaModel.GetTypeDescriptor to retrieve
associated entity type attributes.
* MetaModel.cs: implemented registration of type metadata
cache. Metadata is provided by a set of TypeDescriptionProvider
instances (if ContextConfig is present for given model provider)
or by default type description provider (note that this
functionality is not implemented in
System.ComponentModel.TypeDescriptor yet!).
2009-06-12 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: implemented correct detection of foreign key
columns.
Implemented IsReadOnly, SortColumn, SortDescending.
2009-06-10 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: fixed DisplayName implementation.
Implemented GetPrimaryKeyString, GetQuery.
2009-06-09 Marek Habersack <mhabersack@novell.com>
* MetaTable.cs: implemented more overloads of GetActionPath.
Implemented GetPrimaryKeyValues, GetActionPathFromRoutes,
Attributes, DisplayColumn, GetDisplayString.
2009-06-01 Marek Habersack <mhabersack@novell.com>
* MetaModel.cs: GetModel throws InvalidOperationException on
missing model.
Implemented GetActionPath and GetTable.
2009-04-29 Marek Habersack <mhabersack@novell.com>
* 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 <mhabersack@novell.com>
* ContextConfiguration.cs: implemented all the methods and added a
parameterless constructor.
2008-10-21 Atsushi Enomoto <atsushi@ximian.com>
* DynamicDataRouteHandler.cs, DynamicDataRoute.cs, MetaTable.cs:
ongoing implementation; resolve to page templates.
2008-10-17 Atsushi Enomoto <atsushi@ximian.com>
* DynamicDataRouteHandler.cs, DynamicDataRoute.cs, MetaTable.cs,
MetaModel.cs : ongoing implementation.
2008-10-16 Atsushi Enomoto <atsushi@ximian.com>
* DynamicDataManager.cs, DynamicDataRoute.cs,
FieldTemplateFactory.cs, MetaChildrenColumn.cs,
MetaColumn.cs, MetaForeignKeyColumn.cs, MetaModel.cs, MetaTable.cs:
ongoing implementation.
2008-10-14 Atsushi Enomoto <atsushi@ximian.com>
*.cs : initial checkin. stubs.

View File

@@ -0,0 +1,57 @@
//
// ContextConfiguration.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
// Marek Habersack <mhabersack@novell.com>
//
// 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;
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;
using System.Web.Caching;
using System.Web.DynamicData.ModelProviders;
namespace System.Web.DynamicData
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ContextConfiguration
{
public ContextConfiguration ()
{
MetadataProviderFactory = (Type t) => new AssociatedMetadataTypeTypeDescriptionProvider (t);
}
public Func<Type, TypeDescriptionProvider> MetadataProviderFactory { get; set; }
public bool ScaffoldAllTables { get; set; }
}
}

View File

@@ -0,0 +1,313 @@
//
// DynamicControl.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
// Marek Habersack <mhabersack@novell.com>
//
// 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
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
{
[ToolboxBitmap (typeof(DynamicControl), "DynamicControl.ico")]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DynamicControl : Control, IAttributeAccessor, IFieldTemplateHost, IFieldFormattingOptions
{
Dictionary <string, string> attributes;
bool? applyFormatInEditMode;
bool? convertEmptyStringToNull;
bool? htmlEncode;
string dataField = String.Empty;
string dataFormatString;
string nullDisplayText;
string uiHint;
public DynamicControl () : this (DataBoundControlMode.ReadOnly)
{
}
public DynamicControl (DataBoundControlMode mode)
{
Mode = mode;
CssClass = String.Empty;
ValidationGroup = String.Empty;
}
[Category ("Behavior")]
[DefaultValue (false)]
public bool ApplyFormatInEditMode {
get {
if (applyFormatInEditMode == null) {
MetaColumn column = Column;
applyFormatInEditMode = column != null ? column.ApplyFormatInEditMode : false;
}
return (bool)applyFormatInEditMode;
}
set { applyFormatInEditMode = value; }
}
[Browsable (false)]
public MetaColumn Column { get; set; }
[Category ("Behavior")]
[DefaultValue (false)]
public bool ConvertEmptyStringToNull {
get {
if (convertEmptyStringToNull == null) {
MetaColumn column = Column;
convertEmptyStringToNull = column != null ? column.ConvertEmptyStringToNull : false;
}
return (bool)convertEmptyStringToNull;
}
set { convertEmptyStringToNull = value; }
}
[MonoTODO]
[Category ("Appearance")]
[DefaultValue ("")]
[CssClassProperty]
public virtual string CssClass { get; set; }
[Category ("Data")]
[DefaultValue ("")]
public string DataField {
get { return dataField; }
set { dataField = value == null ? String.Empty : value; }
}
[Category ("Data")]
[DefaultValue ("")]
public string DataFormatString {
get {
if (dataFormatString == null) {
MetaColumn column = Column;
if (column != null) {
dataFormatString = column.DataFormatString;
if (dataFormatString == null)
dataFormatString = String.Empty;
} else
dataFormatString = String.Empty;
}
return dataFormatString;
}
set { dataFormatString = value == null ? String.Empty : value; }
}
[MonoTODO]
[Browsable (false)]
public Control FieldTemplate { get; private set; }
[Category ("Behavior")]
[DefaultValue (true)]
public bool HtmlEncode {
get {
if (htmlEncode == null) {
MetaColumn column = Column;
htmlEncode = column != null ? column.HtmlEncode : true;
}
return (bool)htmlEncode;
}
set { htmlEncode = value; }
}
IFieldFormattingOptions IFieldTemplateHost.FormattingOptions {
get { return this; }
}
[MonoTODO]
public DataBoundControlMode Mode { get; set; }
[Category ("Behavior")]
[DefaultValue ("")]
public string NullDisplayText {
get {
if (nullDisplayText == null) {
MetaColumn column = Column;
if (column != null) {
nullDisplayText = column.NullDisplayText;
if (nullDisplayText == null)
nullDisplayText = String.Empty;
} else
nullDisplayText = String.Empty;
}
return nullDisplayText;
}
set { nullDisplayText = value == null ? String.Empty : value; }
}
[Browsable (false)]
public virtual MetaTable Table {
get { return this.FindMetaTable (); }
}
[Category ("Behavior")]
[DefaultValue ("")]
public virtual string UIHint {
get {
if (uiHint == null) {
MetaColumn column = Column;
uiHint = column != null ? column.UIHint : String.Empty;
if (uiHint == null)
uiHint = String.Empty;
}
return uiHint;
}
set { uiHint = value != null ? value : String.Empty; }
}
[Themeable (false)]
[Category ("Behavior")]
[DefaultValue ("")]
public virtual string ValidationGroup { get; set; }
void CreateFieldTemplate ()
{
MetaColumn column = Column;
// Safe as ResolveColumn won't return with a null Column
MetaModel model = column.Model;
IFieldTemplateFactory ftf = model != null ? model.FieldTemplateFactory : null;
IFieldTemplate ft;
if (ftf != null) {
ft = ftf.CreateFieldTemplate (column, Mode, UIHint);
if (ft == null)
return;
} else
return;
ft.SetHost (this);
Control ctl = ft as Control;
if (ctl == null)
return;
FieldTemplate = ctl;
Controls.Add (ctl);
}
public string GetAttribute (string key)
{
if (attributes == null)
return String.Empty;
string ret;
if (attributes.TryGetValue (key, out ret))
return ret;
else
// "Compatibility"...
throw new KeyNotFoundException ("NoSuchAttribute");
}
protected override void OnInit (EventArgs e)
{
// It seems _all_ the properties are initialized _only_ here. Further user's
// actions to set the Column property don't affect the other properties
// which derive their values from the associated MetaColumn.
base.OnInit (e);
if (Column == null) {
ResolveColumn ();
Controls.Clear ();
CreateFieldTemplate ();
}
}
protected override void Render (HtmlTextWriter writer)
{
string cssClass = CssClass;
bool haveCssClass = !String.IsNullOrEmpty (cssClass);
if (haveCssClass) {
writer.AddAttribute (HtmlTextWriterAttribute.Class, cssClass);
writer.RenderBeginTag (HtmlTextWriterTag.Span);
writer.Write ("\n\n");
}
base.Render (writer);
if (haveCssClass) {
writer.RenderEndTag ();
}
}
void ResolveColumn ()
{
string dataField = DataField;
if (String.IsNullOrEmpty (dataField))
throw new InvalidOperationException ("The '" + GetType ().Name + "' control '" + ID + "' must have a DataField attribute.");
MetaTable table = Table;
// And, as it is .NET DynamicData's tradition... no null check!!
if (table == null)
throw new NullReferenceException ();
Column = table.GetColumn (dataField);
}
internal void InternalSetAttributes (Dictionary <string, string> attributes)
{
this.attributes = attributes;
}
public void SetAttribute (string key, string value)
{
if (attributes == null)
attributes = new Dictionary <string, string> ();
if (attributes.ContainsKey (key))
attributes [key] = value;
else
attributes.Add (key, value);
}
}
}

View File

@@ -0,0 +1,75 @@
//
// DynamicControlParameter.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 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.Specialized;
using System.Globalization;
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
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DynamicControlParameter : Parameter, IWhereParametersProvider
{
[MonoTODO]
public DynamicControlParameter ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public DynamicControlParameter (string controlId)
{
throw new NotImplementedException ();
}
[MonoTODO]
public string ControlId { get; set; }
[MonoTODO]
protected override object Evaluate (HttpContext context, Control control)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual IEnumerable<Parameter> GetWhereParameters (IDynamicDataSource dataSource)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,178 @@
//
// DynamicDataExtensions.cs
//
// Authors:
// Atsushi Enomoto <atsushi@ximian.com>
// Marek Habersack <mhabersack@novell.com>
//
// 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
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
{
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public static class DynamicDataExtensions
{
public static object ConvertEditedValue (this IFieldFormattingOptions formattingOptions, string value)
{
// Not a surprise anymore...
if (formattingOptions == null)
throw new NullReferenceException ();
if (String.IsNullOrEmpty (value)) {
if (formattingOptions.ConvertEmptyStringToNull)
return null;
} else {
string nullDisplayText = formattingOptions.NullDisplayText;
if (!String.IsNullOrEmpty (nullDisplayText) && String.Compare (value, nullDisplayText, StringComparison.Ordinal) == 0)
return null;
}
return value;
}
[MonoTODO]
public static void EnablePersistedSelection (this BaseDataBoundControl dataBoundControl)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void ExpandDynamicWhereParameters (this IDynamicDataSource dataSource)
{
// http://forums.asp.net/p/1396453/3005197.aspx#3005197
}
[MonoTODO]
public static IDynamicDataSource FindDataSourceControl (this Control current)
{
var control = current as BaseDataBoundControl;
if (control == null)
return null;
string dataSourceID = control.DataSourceID;
if (!String.IsNullOrEmpty (dataSourceID))
return control.DataSource as IDynamicDataSource;
Control namingContainer = control.NamingContainer;
IDynamicDataSource dds;
while (namingContainer != null) {
dds = namingContainer.FindControl (dataSourceID) as IDynamicDataSource;
if (dds != null)
return dds;
namingContainer = namingContainer.NamingContainer;
}
return null;
}
[MonoTODO]
public static Control FindFieldTemplate (this Control control, string columnName)
{
throw new NotImplementedException ();
}
public static MetaTable FindMetaTable (this Control current)
{
// .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.DataSourceObject as IDynamicDataSource;
if (dds != null)
return dds.GetTable ();
}
current = current.NamingContainer;
}
return null;
}
[MonoTODO]
public static string FormatEditValue (this IFieldFormattingOptions formattingOptions, object fieldValue)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static string FormatValue (this IFieldFormattingOptions formattingOptions, object fieldValue)
{
throw new NotImplementedException ();
}
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)
{
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]
public static void LoadWithForeignKeys (this LinqDataSource dataSource, Type rowType)
{
throw new NotImplementedException ();
}
}
}

Some files were not shown because too many files have changed in this diff Show More