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
- SqlDataSourceQueryEditorForm.cs
- SQLInt32Storage.cs
- CacheAxisQuery.cs
- TimeSpanMinutesConverter.cs
- IntegrationExceptionEventArgs.cs
- File.cs
- ContextInformation.cs
- HttpCapabilitiesSectionHandler.cs
- CodeRemoveEventStatement.cs
- SimpleWorkerRequest.cs
- StringValidatorAttribute.cs
- MetadataItemCollectionFactory.cs
- DummyDataSource.cs
- BitConverter.cs
- HandledMouseEvent.cs
- GridLength.cs
- FontUnitConverter.cs
- HotSpotCollectionEditor.cs
- ListViewGroupItemCollection.cs
- InstanceData.cs
- Win32.cs
- BinaryMethodMessage.cs
- DeclarationUpdate.cs
- WebResourceUtil.cs
- SequentialOutput.cs
- DispatcherExceptionFilterEventArgs.cs
- InternalsVisibleToAttribute.cs
- TraceHandler.cs
- TypeToken.cs
- MsmqHostedTransportConfiguration.cs
- DesignColumnCollection.cs
- CallSiteBinder.cs
- ToolStripDropDown.cs
- AddInServer.cs
- MessageQueueInstaller.cs
- BooleanExpr.cs
- MetadataItem.cs
- DnsEndPoint.cs
- CommandArguments.cs
- SqlGenerator.cs
- ServiceOperationUIEditor.cs
- ListenerElementsCollection.cs
- AdjustableArrowCap.cs
- FunctionNode.cs
- InteropBitmapSource.cs
- MetadataArtifactLoader.cs
- SmtpMail.cs
- IsolatedStoragePermission.cs
- BorderGapMaskConverter.cs
- DesignerActionTextItem.cs
- Helper.cs
- SqlBuffer.cs
- InternalConfigEventArgs.cs
- Expressions.cs
- StringFunctions.cs
- MemberPath.cs
- Collection.cs
- ProcessStartInfo.cs
- EventProvider.cs
- VideoDrawing.cs
- wmiprovider.cs
- AppDomainShutdownMonitor.cs
- LinkClickEvent.cs
- ItemCheckEvent.cs
- DBSqlParserColumn.cs
- SmtpMail.cs
- WindowsNonControl.cs
- StyleXamlTreeBuilder.cs
- DictionarySectionHandler.cs
- DataGridPagerStyle.cs
- OrderedDictionary.cs
- AvTrace.cs
- MetadataFile.cs
- WriteLine.cs
- Empty.cs
- TextReader.cs
- UDPClient.cs
- RSACryptoServiceProvider.cs
- XmlILModule.cs
- CompilerTypeWithParams.cs
- WsdlEndpointConversionContext.cs
- DiscoveryDocumentSearchPattern.cs
- OracleTransaction.cs
- PkcsUtils.cs
- BamlBinaryWriter.cs
- DataServiceRequest.cs
- ToolBar.cs
- MemoryFailPoint.cs
- versioninfo.cs
- ActionMessageFilter.cs
- JsonQNameDataContract.cs
- XmlSchemaNotation.cs
- SMSvcHost.cs
- ColorConvertedBitmapExtension.cs
- RectangleConverter.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ChtmlFormAdapter.cs
- StickyNote.cs
- TreeNodeStyle.cs
- MatrixStack.cs