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
- FtpWebResponse.cs
- BitmapSourceSafeMILHandle.cs
- Int64Animation.cs
- Script.cs
- SecureStringHasher.cs
- SchemaImporter.cs
- PathFigureCollection.cs
- SerializationStore.cs
- DataGridRow.cs
- WebBrowsableAttribute.cs
- DockingAttribute.cs
- Logging.cs
- SrgsSubset.cs
- ConfigurationElement.cs
- PerfService.cs
- ExpiredSecurityTokenException.cs
- ETagAttribute.cs
- RequestTimeoutManager.cs
- PeerNameResolver.cs
- IPGlobalProperties.cs
- BaseCollection.cs
- TextTrailingCharacterEllipsis.cs
- SecurityResources.cs
- DataListItem.cs
- QilUnary.cs
- WebPartCollection.cs
- RequestCacheEntry.cs
- BreakRecordTable.cs
- CmsInterop.cs
- MobileTemplatedControlDesigner.cs
- MessagePartSpecification.cs
- EdmRelationshipRoleAttribute.cs
- ListViewGroupItemCollection.cs
- TraceFilter.cs
- XmlElementCollection.cs
- XmlSchemaIdentityConstraint.cs
- FixedSOMPage.cs
- BamlLocalizableResource.cs
- DocumentPageViewAutomationPeer.cs
- TextEndOfLine.cs
- TokenizerHelper.cs
- SafeCryptHandles.cs
- TemplateManager.cs
- XmlLangPropertyAttribute.cs
- StateWorkerRequest.cs
- JsonByteArrayDataContract.cs
- PrincipalPermission.cs
- DataControlCommands.cs
- WebPartEventArgs.cs
- unsafenativemethodstextservices.cs
- WebScriptEndpointElement.cs
- SocketPermission.cs
- ParagraphVisual.cs
- MemberPath.cs
- SizeAnimation.cs
- DCSafeHandle.cs
- ResXDataNode.cs
- NodeFunctions.cs
- ClonableStack.cs
- ReadOnlyCollection.cs
- DecoderBestFitFallback.cs
- CellConstantDomain.cs
- SystemUnicastIPAddressInformation.cs
- SafeNativeMethods.cs
- FormClosedEvent.cs
- AppSettingsReader.cs
- ToolStripDropDownClosingEventArgs.cs
- ApplicationCommands.cs
- HttpListenerRequest.cs
- SudsWriter.cs
- SqlServer2KCompatibilityCheck.cs
- BoundField.cs
- Span.cs
- EditorZone.cs
- RegexFCD.cs
- TraceListeners.cs
- EditorPartCollection.cs
- DecimalAnimationUsingKeyFrames.cs
- ObjectSpanRewriter.cs
- QilSortKey.cs
- LeftCellWrapper.cs
- SettingsAttributeDictionary.cs
- ListBoxAutomationPeer.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DbMetaDataColumnNames.cs
- EmptyQuery.cs
- basevalidator.cs
- Italic.cs
- CompositeActivityMarkupSerializer.cs
- DataGridViewDataErrorEventArgs.cs
- Scene3D.cs
- XmlConvert.cs
- IntSecurity.cs
- EdgeModeValidation.cs
- IdentifierCollection.cs
- SimplePropertyEntry.cs
- DebugHandleTracker.cs
- Cursor.cs
- Point3DAnimationUsingKeyFrames.cs
- ContainerUtilities.cs