Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / UI / DataControlExtensions.cs / 1305376 / DataControlExtensions.cs
namespace System.Web.UI { using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Web.DynamicData; public static class DataControlExtensions { private readonly static ConcurrentDictionarys_MetaTableCache = new ConcurrentDictionary (); public static void EnableDynamicData(this INamingContainer control, Type entityType, object defaults) { MetaTable table = GetTableFromCache(entityType); control.SetMetaTable(table, defaults); DynamicDataExtensions.ApplyFieldGenerator(control, table); } public static void EnableDynamicData(this INamingContainer control, Type entityType, IDictionary defaultValues) { MetaTable table = GetTableFromCache(entityType); control.SetMetaTable(table, defaultValues); DynamicDataExtensions.ApplyFieldGenerator(control, table); } public static void EnableDynamicData(this INamingContainer control, Type entityType) { MetaTable table = GetTableFromCache(entityType); control.SetMetaTable(table); DynamicDataExtensions.ApplyFieldGenerator(control, table); } private static MetaTable GetTableFromCache(Type entityType) { MetaTable table; if (!s_MetaTableCache.TryGetValue(entityType, out table)) { table = MetaTable.CreateTable(entityType); table.Model.FieldTemplateFactory = new SimpleFieldTemplateFactory(); s_MetaTableCache.TryAdd(entityType, table); } return table; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaComplexType.cs
- WizardPanel.cs
- URIFormatException.cs
- Polygon.cs
- Model3D.cs
- Misc.cs
- CodeSnippetExpression.cs
- SessionPageStateSection.cs
- WorkflowDesignerColors.cs
- InlineObject.cs
- QilNode.cs
- Adorner.cs
- ControlCachePolicy.cs
- GridLength.cs
- AttributeQuery.cs
- PaperSize.cs
- DbModificationClause.cs
- TypedServiceChannelBuilder.cs
- GradientPanel.cs
- DefaultTextStoreTextComposition.cs
- ResourcePermissionBaseEntry.cs
- ContextConfiguration.cs
- ResourceAssociationType.cs
- XmlQuerySequence.cs
- XsltSettings.cs
- UnknownWrapper.cs
- HandlerFactoryCache.cs
- DetailsViewDeletedEventArgs.cs
- BinaryNode.cs
- RoleManagerEventArgs.cs
- XmlSchemaChoice.cs
- ReadOnlyAttribute.cs
- XmlEventCache.cs
- ServiceDocument.cs
- URLString.cs
- LinearGradientBrush.cs
- XmlSchemaSimpleContentRestriction.cs
- XmlDocumentType.cs
- CustomErrorCollection.cs
- SemaphoreSecurity.cs
- UncommonField.cs
- AsyncStreamReader.cs
- SafeViewOfFileHandle.cs
- WpfPayload.cs
- ObjectContextServiceProvider.cs
- TextHintingModeValidation.cs
- Point3DAnimation.cs
- CalendarItem.cs
- WindowInteractionStateTracker.cs
- Hash.cs
- Hash.cs
- QuaternionRotation3D.cs
- ToolboxItemCollection.cs
- ButtonChrome.cs
- AttributeAction.cs
- HealthMonitoringSectionHelper.cs
- TagElement.cs
- ChangeNode.cs
- PrinterUnitConvert.cs
- ClosableStream.cs
- MaxMessageSizeStream.cs
- Update.cs
- AuthenticationModuleElement.cs
- ImageSourceValueSerializer.cs
- SerializationObjectManager.cs
- GeneralTransform.cs
- AppDomain.cs
- NativeMethods.cs
- LayoutInformation.cs
- DynamicControl.cs
- IISMapPath.cs
- OleDbCommand.cs
- RelationshipWrapper.cs
- DirtyTextRange.cs
- AppliesToBehaviorDecisionTable.cs
- SchemaMerger.cs
- TextLineBreak.cs
- XmlReflectionMember.cs
- CategoryList.cs
- TreeView.cs
- ViewManager.cs
- ApplicationContext.cs
- CompositeScriptReference.cs
- WCFModelStrings.Designer.cs
- ItemCheckedEvent.cs
- PersistenceTypeAttribute.cs
- FixedPageStructure.cs
- ByteAnimationUsingKeyFrames.cs
- System.Data_BID.cs
- SafeLibraryHandle.cs
- WebSysDefaultValueAttribute.cs
- SimpleHandlerBuildProvider.cs
- RuntimeConfig.cs
- XmlAttributeAttribute.cs
- DataTableMapping.cs
- ColorConverter.cs
- safex509handles.cs
- FloaterBaseParaClient.cs
- FormsAuthenticationUserCollection.cs
- IApplicationTrustManager.cs