Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DataObjectFieldAttribute.cs / 1 / DataObjectFieldAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Security.Permissions; ////// Represents a field of a DataObject. Use this attribute on a field to indicate /// properties such as primary key, identity, nullability, and length. /// [AttributeUsage(AttributeTargets.Property)] public sealed class DataObjectFieldAttribute : Attribute { private bool _primaryKey; private bool _isIdentity; private bool _isNullable; private int _length; public DataObjectFieldAttribute(bool primaryKey) : this(primaryKey, false, false, -1) { } public DataObjectFieldAttribute(bool primaryKey, bool isIdentity) : this(primaryKey, isIdentity, false, -1) { } public DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable) : this(primaryKey, isIdentity, isNullable, -1){ } public DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable, int length) { _primaryKey = primaryKey; _isIdentity = isIdentity; _isNullable = isNullable; _length = length; } public bool IsIdentity { get { return _isIdentity; } } public bool IsNullable { get { return _isNullable; } } public int Length { get { return _length; } } public bool PrimaryKey { get { return _primaryKey; } } public override bool Equals(object obj) { if (obj == this) { return true; } DataObjectFieldAttribute other = obj as DataObjectFieldAttribute; return (other != null) && (other.IsIdentity == IsIdentity) && (other.IsNullable == IsNullable) && (other.Length == Length) && (other.PrimaryKey == PrimaryKey); } public override int GetHashCode() { return base.GetHashCode(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeInfo.cs
- ToolZone.cs
- WebPartDisplayMode.cs
- EntityViewGenerationAttribute.cs
- ExpandableObjectConverter.cs
- AttachmentService.cs
- HealthMonitoringSection.cs
- StatusBarDrawItemEvent.cs
- ServerIdentity.cs
- SqlDataRecord.cs
- SchemaNames.cs
- ProxyElement.cs
- ToolStripItemRenderEventArgs.cs
- ItemAutomationPeer.cs
- PropertyEmitter.cs
- SqlDataSource.cs
- CookieParameter.cs
- EventProviderClassic.cs
- MimeTypeAttribute.cs
- Authorization.cs
- LifetimeMonitor.cs
- TypeForwardedFromAttribute.cs
- BookmarkInfo.cs
- StringAnimationBase.cs
- DelegatingChannelListener.cs
- HandledMouseEvent.cs
- HttpContextServiceHost.cs
- AssemblyBuilder.cs
- DesignerDataSchemaClass.cs
- ISAPIWorkerRequest.cs
- ChtmlPhoneCallAdapter.cs
- DrawingContextDrawingContextWalker.cs
- DBDataPermission.cs
- BaseComponentEditor.cs
- CompletionProxy.cs
- DBCommand.cs
- BinaryMessageFormatter.cs
- StorageAssociationSetMapping.cs
- TerminatingOperationBehavior.cs
- CompareInfo.cs
- InternalMappingException.cs
- XmlValidatingReader.cs
- SymbolType.cs
- UnsafePeerToPeerMethods.cs
- InputLanguageProfileNotifySink.cs
- PageParserFilter.cs
- LocalizedNameDescriptionPair.cs
- QilReference.cs
- ThousandthOfEmRealDoubles.cs
- BitmapFrame.cs
- DSASignatureDeformatter.cs
- LockCookie.cs
- PropertyValueChangedEvent.cs
- ImageMapEventArgs.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- CreatingCookieEventArgs.cs
- SiteMapDataSourceDesigner.cs
- CompilationRelaxations.cs
- NavigationProgressEventArgs.cs
- StringArrayConverter.cs
- CodeIdentifier.cs
- Trigger.cs
- RuntimeEnvironment.cs
- ProfileSettingsCollection.cs
- XmlSignificantWhitespace.cs
- CallbackValidator.cs
- securitycriticaldataformultiplegetandset.cs
- WmpBitmapEncoder.cs
- QueryResponse.cs
- EditCommandColumn.cs
- ConnectionInterfaceCollection.cs
- ScalarRestriction.cs
- ServiceXNameTypeConverter.cs
- ConfigurationSchemaErrors.cs
- UriSection.cs
- keycontainerpermission.cs
- COM2ExtendedTypeConverter.cs
- ErrorWrapper.cs
- XmlQueryCardinality.cs
- TextCollapsingProperties.cs
- WebPartChrome.cs
- MarkupWriter.cs
- PersonalizationState.cs
- ConsumerConnectionPoint.cs
- CompatibleIComparer.cs
- _Connection.cs
- ProgressBarAutomationPeer.cs
- LoginAutoFormat.cs
- Errors.cs
- PropertyToken.cs
- IdentityHolder.cs
- ListSourceHelper.cs
- JavaScriptSerializer.cs
- Encoder.cs
- LinkArea.cs
- FactoryId.cs
- TickBar.cs
- ClientConfigPaths.cs
- ProjectionCamera.cs
- RoutedEventArgs.cs