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
- DataPagerField.cs
- ManualResetEvent.cs
- OleDbInfoMessageEvent.cs
- CodeRemoveEventStatement.cs
- PageStatePersister.cs
- BlurBitmapEffect.cs
- ProcessManager.cs
- Polygon.cs
- ViewGenResults.cs
- ToolStripGripRenderEventArgs.cs
- Point.cs
- FileDataSourceCache.cs
- DetailsViewInsertedEventArgs.cs
- FileEnumerator.cs
- PageAsyncTaskManager.cs
- Function.cs
- ContainerParagraph.cs
- ConfigPathUtility.cs
- HtmlInputReset.cs
- DBConnectionString.cs
- SignerInfo.cs
- ComponentResourceKeyConverter.cs
- TreePrinter.cs
- XamlWrappingReader.cs
- EventRoute.cs
- XmlEnumAttribute.cs
- MetadataSerializer.cs
- DesignerActionUI.cs
- PieceNameHelper.cs
- SettingsAttributes.cs
- LinqDataSourceEditData.cs
- SingleAnimation.cs
- Parser.cs
- ParentUndoUnit.cs
- HideDisabledControlAdapter.cs
- ComponentEditorForm.cs
- File.cs
- DocumentPageView.cs
- AdjustableArrowCap.cs
- FusionWrap.cs
- DeviceSpecificDesigner.cs
- FontStyles.cs
- mediaeventargs.cs
- CalendarModeChangedEventArgs.cs
- ObjectTypeMapping.cs
- XmlSchemaDatatype.cs
- OdbcUtils.cs
- UdpDiscoveryEndpoint.cs
- LocatorPartList.cs
- QuaternionKeyFrameCollection.cs
- HttpHandlersInstallComponent.cs
- FigureParaClient.cs
- FormsAuthenticationCredentials.cs
- DesignTableCollection.cs
- AuthStoreRoleProvider.cs
- GreenMethods.cs
- SurrogateEncoder.cs
- DeferredSelectedIndexReference.cs
- EasingFunctionBase.cs
- Base64Encoding.cs
- CodeTypeReferenceExpression.cs
- Utility.cs
- FormatterConverter.cs
- BrushMappingModeValidation.cs
- WebPartDisplayModeEventArgs.cs
- DataSourceControlBuilder.cs
- PenLineJoinValidation.cs
- SqlDataReaderSmi.cs
- ListViewItem.cs
- RsaKeyIdentifierClause.cs
- DetailsViewRow.cs
- RegularExpressionValidator.cs
- QueryModel.cs
- ProfessionalColors.cs
- WebBrowserNavigatedEventHandler.cs
- KnownTypeDataContractResolver.cs
- MultiByteCodec.cs
- DoubleKeyFrameCollection.cs
- _LocalDataStoreMgr.cs
- Block.cs
- MsiStyleLogWriter.cs
- ClientFormsIdentity.cs
- WinFormsUtils.cs
- AssemblyBuilder.cs
- GregorianCalendarHelper.cs
- WindowsSysHeader.cs
- CLRBindingWorker.cs
- SessionState.cs
- BuilderInfo.cs
- FloatUtil.cs
- PageAsyncTask.cs
- ContextProperty.cs
- XPathEmptyIterator.cs
- SymLanguageVendor.cs
- Grant.cs
- UriWriter.cs
- XmlResolver.cs
- XhtmlBasicListAdapter.cs
- SslSecurityTokenParameters.cs
- XmlDocumentSerializer.cs