Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DataObjectFieldAttribute.cs / 1305376 / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XPathArrayIterator.cs
- PinnedBufferMemoryStream.cs
- XmlNullResolver.cs
- DocumentViewerAutomationPeer.cs
- OneOfElement.cs
- SearchExpression.cs
- Int32Collection.cs
- CSharpCodeProvider.cs
- StandardCommands.cs
- FullTextLine.cs
- FeatureSupport.cs
- DbResourceAllocator.cs
- AttributeProviderAttribute.cs
- ReadOnlyPropertyMetadata.cs
- PropertyTabChangedEvent.cs
- TemplateContainer.cs
- OdbcUtils.cs
- XmlDataDocument.cs
- ListViewGroupCollectionEditor.cs
- PropertyPushdownHelper.cs
- GeneratedCodeAttribute.cs
- HyperLinkField.cs
- MainMenu.cs
- SqlCacheDependency.cs
- TextTreeUndo.cs
- ContractHandle.cs
- LinkClickEvent.cs
- StringBuilder.cs
- ResourceContainerWrapper.cs
- SQLBoolean.cs
- MostlySingletonList.cs
- MsmqInputMessagePool.cs
- TiffBitmapDecoder.cs
- CorrelationToken.cs
- IsolatedStorageFile.cs
- BufferedGraphicsManager.cs
- FrameDimension.cs
- DbConnectionPoolGroupProviderInfo.cs
- DiscoveryOperationContextExtension.cs
- LineProperties.cs
- GeometryValueSerializer.cs
- DataGridViewRowPrePaintEventArgs.cs
- CredentialManagerDialog.cs
- _PooledStream.cs
- HealthMonitoringSectionHelper.cs
- OlePropertyStructs.cs
- CompiledRegexRunner.cs
- ScrollBarAutomationPeer.cs
- SystemIcons.cs
- ReferentialConstraint.cs
- NativeMethods.cs
- DetailsView.cs
- _NetworkingPerfCounters.cs
- XmlBinaryReader.cs
- SplineQuaternionKeyFrame.cs
- DbLambda.cs
- QuotedStringWriteStateInfo.cs
- FilterException.cs
- BulletedListEventArgs.cs
- BamlVersionHeader.cs
- PropertiesTab.cs
- ImageMetadata.cs
- SemaphoreFullException.cs
- ToolStripItem.cs
- ThreadAbortException.cs
- BufferedReadStream.cs
- SqlResolver.cs
- X509DefaultServiceCertificateElement.cs
- DurableEnlistmentState.cs
- DomainUpDown.cs
- AttachmentService.cs
- FastEncoderStatics.cs
- DataListItemEventArgs.cs
- RelationalExpressions.cs
- MailMessageEventArgs.cs
- InvokeSchedule.cs
- SkinBuilder.cs
- CssTextWriter.cs
- PersonalizationProvider.cs
- UrlRoutingHandler.cs
- WebColorConverter.cs
- ExceptionHandlersDesigner.cs
- NopReturnReader.cs
- FontStretchConverter.cs
- XmlTextAttribute.cs
- CodeDelegateInvokeExpression.cs
- GetPageNumberCompletedEventArgs.cs
- FocusTracker.cs
- Executor.cs
- AccessibleObject.cs
- StringOutput.cs
- RadialGradientBrush.cs
- ChangePasswordDesigner.cs
- DummyDataSource.cs
- ListCollectionView.cs
- IsolatedStorageFilePermission.cs
- Char.cs
- Image.cs
- Popup.cs
- BookmarkUndoUnit.cs