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
- EncryptedPackageFilter.cs
- CryptoApi.cs
- FormViewInsertedEventArgs.cs
- Italic.cs
- AppDomainManager.cs
- DataSourceExpressionCollection.cs
- InvokePattern.cs
- HTMLTagNameToTypeMapper.cs
- EventSinkHelperWriter.cs
- GPPOINT.cs
- RoleServiceManager.cs
- DependencyPropertyHelper.cs
- CacheRequest.cs
- Sequence.cs
- SqlUserDefinedAggregateAttribute.cs
- DataGridViewComboBoxColumn.cs
- PointConverter.cs
- Symbol.cs
- Compiler.cs
- Cursor.cs
- StateMachineHistory.cs
- ConnectivityStatus.cs
- SiteMapNodeCollection.cs
- ProvidersHelper.cs
- TypeBuilderInstantiation.cs
- StringUtil.cs
- BitVector32.cs
- ToolStripScrollButton.cs
- CrossAppDomainChannel.cs
- DataGridrowEditEndingEventArgs.cs
- SignatureHelper.cs
- XmlDocumentFragment.cs
- CorrelationTokenTypeConvertor.cs
- HWStack.cs
- X509Certificate.cs
- XamlFxTrace.cs
- ThemeInfoAttribute.cs
- ChangeTracker.cs
- JobCollate.cs
- DefaultMemberAttribute.cs
- SoapServerMessage.cs
- _SingleItemRequestCache.cs
- DSASignatureDeformatter.cs
- LocalizabilityAttribute.cs
- SplitterEvent.cs
- CollectionViewGroupRoot.cs
- InternalBufferOverflowException.cs
- FastEncoder.cs
- SchemaInfo.cs
- WebEvents.cs
- JournalEntry.cs
- WindowsStreamSecurityUpgradeProvider.cs
- EndpointDiscoveryMetadataCD1.cs
- AsymmetricSignatureDeformatter.cs
- ObjectViewListener.cs
- Button.cs
- TemplateBuilder.cs
- DataGridViewCell.cs
- BooleanFunctions.cs
- UInt32Converter.cs
- followingsibling.cs
- PenCursorManager.cs
- DesigntimeLicenseContext.cs
- TargetConverter.cs
- XmlLinkedNode.cs
- DesignerAutoFormat.cs
- __Error.cs
- ICspAsymmetricAlgorithm.cs
- LexicalChunk.cs
- SecurityPolicySection.cs
- LinkDesigner.cs
- NavigationProperty.cs
- TextDataBindingHandler.cs
- RegistryExceptionHelper.cs
- SqlServices.cs
- ObjectSecurity.cs
- PageSetupDialog.cs
- SecurityPolicySection.cs
- DragDeltaEventArgs.cs
- KoreanCalendar.cs
- SHA1CryptoServiceProvider.cs
- QilInvokeEarlyBound.cs
- SerialStream.cs
- HandledEventArgs.cs
- ProfileProvider.cs
- SpellCheck.cs
- HebrewNumber.cs
- LZCodec.cs
- AlignmentYValidation.cs
- ContentElement.cs
- OracleRowUpdatingEventArgs.cs
- SqlError.cs
- BuilderElements.cs
- ConfigurationStrings.cs
- ColumnHeaderConverter.cs
- OutOfProcStateClientManager.cs
- _SecureChannel.cs
- UpdatePanelTrigger.cs
- NumericExpr.cs
- HtmlImage.cs