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
- SystemIPGlobalProperties.cs
- XmlCharCheckingWriter.cs
- QilIterator.cs
- DefaultExpressionVisitor.cs
- CompressedStack.cs
- WebPartActionVerb.cs
- ContainerControlDesigner.cs
- RegexRunner.cs
- TimeEnumHelper.cs
- LinkedList.cs
- FrameworkContextData.cs
- AdRotatorDesigner.cs
- HttpRuntimeSection.cs
- SafeFileHandle.cs
- LogEntrySerialization.cs
- FileDialogCustomPlacesCollection.cs
- ColorMatrix.cs
- AlternateView.cs
- Compiler.cs
- ScriptReference.cs
- ContainerUtilities.cs
- Unit.cs
- PropertyGridView.cs
- DataKeyArray.cs
- StylusButtonCollection.cs
- storepermissionattribute.cs
- ProcessActivityTreeOptions.cs
- ChangesetResponse.cs
- GetWinFXPath.cs
- TopClause.cs
- TableItemProviderWrapper.cs
- RelationshipNavigation.cs
- SiteMapHierarchicalDataSourceView.cs
- AuthenticationManager.cs
- TextSimpleMarkerProperties.cs
- BaseParagraph.cs
- Compilation.cs
- MethodBuilder.cs
- ClientTarget.cs
- ResolveNameEventArgs.cs
- EntityDataSourceContainerNameConverter.cs
- PathFigureCollection.cs
- Int64AnimationUsingKeyFrames.cs
- ObjectAnimationBase.cs
- CultureInfo.cs
- DecimalStorage.cs
- ManagedWndProcTracker.cs
- PictureBox.cs
- HtmlInputFile.cs
- TaskFormBase.cs
- InfoCardSymmetricCrypto.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- Inflater.cs
- OpenFileDialog.cs
- TreeNodeBinding.cs
- XamlDesignerSerializationManager.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- EventMappingSettingsCollection.cs
- AdapterDictionary.cs
- basevalidator.cs
- UInt64Converter.cs
- TokenizerHelper.cs
- UIElementPropertyUndoUnit.cs
- DbConnectionFactory.cs
- EllipseGeometry.cs
- CanExecuteRoutedEventArgs.cs
- WeakHashtable.cs
- RelationshipEnd.cs
- DelegateCompletionCallbackWrapper.cs
- InlineUIContainer.cs
- Util.cs
- DataSourceView.cs
- X509Utils.cs
- DataGridPreparingCellForEditEventArgs.cs
- ExceptionTrace.cs
- CopyAction.cs
- ItemMap.cs
- EntityContainerAssociationSet.cs
- RawKeyboardInputReport.cs
- CompilerErrorCollection.cs
- Dynamic.cs
- NullableDecimalAverageAggregationOperator.cs
- SchemaTypeEmitter.cs
- TableDetailsRow.cs
- DataGridCell.cs
- ProgressBar.cs
- StreamWriter.cs
- XmlSchemaAnnotation.cs
- DesignerAttribute.cs
- LinkConverter.cs
- LocatorManager.cs
- DbBuffer.cs
- SrgsItemList.cs
- ContentElement.cs
- WebPartHeaderCloseVerb.cs
- MeasurementDCInfo.cs
- MergeLocalizationDirectives.cs
- JapaneseLunisolarCalendar.cs
- SchemaTableColumn.cs
- AdjustableArrowCap.cs