Code:
/ 4.0 / 4.0 / 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. 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
- MenuScrollingVisibilityConverter.cs
- PriorityItem.cs
- SqlProfileProvider.cs
- ReadOnlyDataSource.cs
- AgileSafeNativeMemoryHandle.cs
- XmlSchemaSimpleType.cs
- URI.cs
- BamlLocalizableResourceKey.cs
- ParameterBuilder.cs
- MarkupExtensionParser.cs
- SmiTypedGetterSetter.cs
- LogAppendAsyncResult.cs
- ReadContentAsBinaryHelper.cs
- Composition.cs
- ProfileSettingsCollection.cs
- XmlCollation.cs
- FontInfo.cs
- XslTransform.cs
- RegexCaptureCollection.cs
- RadioButton.cs
- WebBrowserBase.cs
- RequestCacheValidator.cs
- XPathNodePointer.cs
- BaseProcessor.cs
- ProgressBarRenderer.cs
- BufferedStream.cs
- DefaultParameterValueAttribute.cs
- messageonlyhwndwrapper.cs
- RealizationDrawingContextWalker.cs
- WaitHandle.cs
- ListDataHelper.cs
- ErrorHandler.cs
- CodeTypeParameterCollection.cs
- Int32EqualityComparer.cs
- ArcSegment.cs
- ListContractAdapter.cs
- Reference.cs
- SafeArrayRankMismatchException.cs
- ZipIORawDataFileBlock.cs
- SqlDataSourceStatusEventArgs.cs
- HtmlInputCheckBox.cs
- SqlCharStream.cs
- AdapterDictionary.cs
- TextSpanModifier.cs
- SessionEndingCancelEventArgs.cs
- ReliableReplySessionChannel.cs
- IgnoreFlushAndCloseStream.cs
- ColorBlend.cs
- SerializationTrace.cs
- DataBoundLiteralControl.cs
- ResourceDefaultValueAttribute.cs
- CollectionContainer.cs
- ProtectedConfigurationSection.cs
- XamlSerializationHelper.cs
- IDQuery.cs
- EventBookmark.cs
- CultureTable.cs
- IgnoreDataMemberAttribute.cs
- BitmapMetadataEnumerator.cs
- ClientScriptManager.cs
- XPathItem.cs
- SessionPageStateSection.cs
- GenerateScriptTypeAttribute.cs
- EncryptedPackageFilter.cs
- SessionState.cs
- LabelLiteral.cs
- TrackingServices.cs
- CurrentTimeZone.cs
- StreamMarshaler.cs
- BrowserCapabilitiesFactoryBase.cs
- SelectorAutomationPeer.cs
- WorkflowInstance.cs
- XmlSchemaAnnotated.cs
- TextSchema.cs
- DiscoveryRequestHandler.cs
- PolicyValidationException.cs
- DateTimePicker.cs
- PerformanceCounterManager.cs
- MulticastDelegate.cs
- DataGridViewDesigner.cs
- TdsParserStaticMethods.cs
- StringAnimationUsingKeyFrames.cs
- hresults.cs
- SafeCertificateContext.cs
- EventSource.cs
- WithParamAction.cs
- DataGridViewRowsAddedEventArgs.cs
- QueryGeneratorBase.cs
- PersistenceTypeAttribute.cs
- ArglessEventHandlerProxy.cs
- StringInfo.cs
- ParameterToken.cs
- XmlFormatWriterGenerator.cs
- WebBrowserUriTypeConverter.cs
- HashMembershipCondition.cs
- DataListItem.cs
- TriggerActionCollection.cs
- ClientBuildManagerCallback.cs
- RtfFormatStack.cs
- WebAdminConfigurationHelper.cs