Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / ModelProviders / SimpleTableProvider.cs / 1305376 / SimpleTableProvider.cs
namespace System.Web.DynamicData.ModelProviders { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections.ObjectModel; using System.ComponentModel; internal sealed class SimpleTableProvider : TableProvider { private List_columns; private ICustomTypeDescriptor _descriptor; public SimpleTableProvider(DataModelProvider modelProvider, Type entityType) : base(modelProvider) { if (entityType == null) { throw new ArgumentNullException("entityType"); } EntityType = entityType; Name = entityType.Name; DataContextPropertyName = String.Empty; InitializeColumns(TypeDescriptor.GetProperties(entityType)); } public SimpleTableProvider(DataModelProvider modelProvider, ICustomTypeDescriptor descriptor) : base(modelProvider) { if (descriptor == null) { throw new ArgumentNullException("descriptor"); } _descriptor = descriptor; Name = descriptor.GetClassName(); DataContextPropertyName = String.Empty; InitializeColumns(descriptor.GetProperties()); } public override ReadOnlyCollection Columns { get { return _columns.AsReadOnly(); } } public override ICustomTypeDescriptor GetTypeDescriptor() { return _descriptor ?? base.GetTypeDescriptor(); } public override IQueryable GetQuery(object context) { throw new NotSupportedException(); } private void InitializeColumns(PropertyDescriptorCollection columnDescriptors) { _columns = columnDescriptors.OfType ().Select(p => new SimpleColumnProvider(this, p)).OfType ().ToList(); } } } // 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
- NumericExpr.cs
- ComboBox.cs
- OleDbInfoMessageEvent.cs
- SmtpException.cs
- Viewport2DVisual3D.cs
- _SpnDictionary.cs
- XmlCharacterData.cs
- DataObject.cs
- SafeFileMappingHandle.cs
- ScrollItemProviderWrapper.cs
- X509SecurityToken.cs
- Point4D.cs
- SiteIdentityPermission.cs
- Rotation3D.cs
- FactoryMaker.cs
- SeverityFilter.cs
- WizardForm.cs
- IteratorFilter.cs
- SqlConnectionHelper.cs
- StringInfo.cs
- ComAdminInterfaces.cs
- PageStatePersister.cs
- CookielessHelper.cs
- WebEventTraceProvider.cs
- ExpressionEvaluator.cs
- CategoryAttribute.cs
- DetailsViewPageEventArgs.cs
- FileDialog_Vista.cs
- WebPartMenuStyle.cs
- AndCondition.cs
- EpmCustomContentDeSerializer.cs
- MenuItemStyle.cs
- DataSysAttribute.cs
- PrimitiveList.cs
- DataGridItemEventArgs.cs
- FacetEnabledSchemaElement.cs
- EventMappingSettings.cs
- MessageQueueException.cs
- ExpandCollapsePattern.cs
- GenericTextProperties.cs
- EventDescriptor.cs
- InternalSafeNativeMethods.cs
- ProcessHostServerConfig.cs
- InfiniteIntConverter.cs
- ColorAnimationBase.cs
- ChangeNode.cs
- SctClaimDictionary.cs
- RoutedPropertyChangedEventArgs.cs
- errorpatternmatcher.cs
- WebPartDeleteVerb.cs
- XmlDocumentSchema.cs
- DeclarativeCatalogPart.cs
- ToolstripProfessionalRenderer.cs
- ModelTreeEnumerator.cs
- TypeToken.cs
- XmlHierarchicalEnumerable.cs
- DataPagerFieldCommandEventArgs.cs
- BadImageFormatException.cs
- SqlXmlStorage.cs
- SimpleNameService.cs
- StackOverflowException.cs
- RichTextBoxConstants.cs
- LinkConverter.cs
- ColumnResizeAdorner.cs
- InkCanvasSelectionAdorner.cs
- CodeDefaultValueExpression.cs
- ObjectItemCollection.cs
- OleDbCommand.cs
- HandledEventArgs.cs
- WindowsListViewGroupHelper.cs
- DataControlReferenceCollection.cs
- SchemaCollectionPreprocessor.cs
- ErrorLog.cs
- ReadOnlyDictionary.cs
- OdbcRowUpdatingEvent.cs
- GridViewSelectEventArgs.cs
- ChangeNode.cs
- NumberFunctions.cs
- DbDataRecord.cs
- XD.cs
- ValueConversionAttribute.cs
- XmlSchemaValidationException.cs
- MemoryRecordBuffer.cs
- hresults.cs
- DataGridTextBox.cs
- TouchEventArgs.cs
- HttpApplicationStateWrapper.cs
- COM2FontConverter.cs
- ConstraintStruct.cs
- DoneReceivingAsyncResult.cs
- DefaultEventAttribute.cs
- DataGridViewHeaderCell.cs
- filewebrequest.cs
- Tool.cs
- DescendentsWalker.cs
- AutomationPropertyInfo.cs
- ToolBarOverflowPanel.cs
- ErrorFormatter.cs
- PresentationTraceSources.cs
- MethodCallConverter.cs