Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / ModelProviders / SimpleColumnProvider.cs / 1407647 / SimpleColumnProvider.cs
namespace System.Web.DynamicData.ModelProviders {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Resources;
internal sealed class SimpleColumnProvider : ColumnProvider {
public SimpleColumnProvider(TableProvider tableProvider, PropertyDescriptor propertyDescriptor)
: base(tableProvider) {
if (propertyDescriptor.PropertyType == null) {
throw new ArgumentNullException(DynamicDataResources.SimpleColumnProvider_ColumnTypeRequired);
}
Name = propertyDescriptor.Name;
ColumnType = propertyDescriptor.PropertyType;
IsPrimaryKey = propertyDescriptor.Attributes.OfType().Any();
Nullable = Misc.TypeAllowsNull(ColumnType);
IsReadOnly = propertyDescriptor.IsReadOnly;
IsSortable = true;
}
public override AttributeCollection Attributes {
get {
if (!Misc.IsBindableType(ColumnType)) {
return AttributeCollection.FromExisting(base.Attributes, new ScaffoldColumnAttribute(false));
}
return base.Attributes;
}
}
}
}
// 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
- ToolStripSplitButton.cs
- ParserContext.cs
- HtmlInputFile.cs
- ReadOnlyState.cs
- ConfigWriter.cs
- SlipBehavior.cs
- OleDbConnection.cs
- SpecialFolderEnumConverter.cs
- HostedHttpTransportManager.cs
- IisTraceListener.cs
- Cloud.cs
- Int32CollectionValueSerializer.cs
- GenericUriParser.cs
- RtfNavigator.cs
- QilTargetType.cs
- CompressStream.cs
- ConsoleKeyInfo.cs
- securestring.cs
- CharacterBufferReference.cs
- WebServicesSection.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- PagedDataSource.cs
- ZipIOExtraFieldPaddingElement.cs
- DocumentsTrace.cs
- DoWorkEventArgs.cs
- MouseActionConverter.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ParameterModifier.cs
- ItemsPresenter.cs
- DelegateTypeInfo.cs
- DataServiceConfiguration.cs
- ListSortDescription.cs
- ToolboxCategory.cs
- BuildProvider.cs
- MenuItemStyleCollection.cs
- ImmutableCollection.cs
- ServiceRoute.cs
- Console.cs
- XNameConverter.cs
- MatrixCamera.cs
- AddInController.cs
- NotImplementedException.cs
- Boolean.cs
- FreezableCollection.cs
- NeutralResourcesLanguageAttribute.cs
- PropertyNames.cs
- ShapingEngine.cs
- EtwProvider.cs
- DbProviderServices.cs
- CopyOnWriteList.cs
- TTSEngineProxy.cs
- IgnoreFlushAndCloseStream.cs
- SmtpDateTime.cs
- XmlElementElement.cs
- CheckBoxBaseAdapter.cs
- ListBindingConverter.cs
- QilIterator.cs
- NoResizeSelectionBorderGlyph.cs
- OleDbReferenceCollection.cs
- CloudCollection.cs
- ComPersistableTypeElementCollection.cs
- TypeCacheManager.cs
- InstanceData.cs
- Transform3DCollection.cs
- SmiEventSink.cs
- DiagnosticsElement.cs
- XmlConvert.cs
- XmlCharCheckingWriter.cs
- HttpHandlersSection.cs
- XmlAttributes.cs
- KoreanLunisolarCalendar.cs
- HtmlMeta.cs
- AcceleratedTokenAuthenticator.cs
- EncoderExceptionFallback.cs
- CompositeDesignerAccessibleObject.cs
- ReflectionServiceProvider.cs
- Funcletizer.cs
- log.cs
- ColumnResizeAdorner.cs
- XmlBufferReader.cs
- NumericUpDownAcceleration.cs
- DocumentApplicationJournalEntry.cs
- PeerInvitationResponse.cs
- HtmlAnchor.cs
- IPHostEntry.cs
- SqlBuilder.cs
- LineSegment.cs
- MessageBox.cs
- MetaModel.cs
- ParsedRoute.cs
- SqlNotificationRequest.cs
- CodeIdentifiers.cs
- ColumnClickEvent.cs
- AnnotationResourceChangedEventArgs.cs
- ProgressiveCrcCalculatingStream.cs
- Themes.cs
- MasterPageBuildProvider.cs
- TileModeValidation.cs
- CodeConstructor.cs
- DataGridToolTip.cs