Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BitmapPalette.cs
- SpecialNameAttribute.cs
- EditorZoneBase.cs
- RemoteHelper.cs
- UIServiceHelper.cs
- DataGridColumn.cs
- RequestCacheEntry.cs
- NullExtension.cs
- SignatureHelper.cs
- BamlLocalizableResource.cs
- WebPartConnectionsCloseVerb.cs
- DataTablePropertyDescriptor.cs
- AsymmetricKeyExchangeDeformatter.cs
- RenderDataDrawingContext.cs
- XamlReaderHelper.cs
- EntityDataSourceWrapper.cs
- AliasedSlot.cs
- Substitution.cs
- DataGridViewCellLinkedList.cs
- X509CertificateValidator.cs
- TCPListener.cs
- CodeNamespaceCollection.cs
- Visual3DCollection.cs
- AspProxy.cs
- SplineKeyFrames.cs
- AuthenticateEventArgs.cs
- PointLightBase.cs
- KnownBoxes.cs
- VariantWrapper.cs
- _AutoWebProxyScriptEngine.cs
- ModelItem.cs
- XslAst.cs
- HttpException.cs
- WizardPanelChangingEventArgs.cs
- BindingExpressionUncommonField.cs
- ComPlusDiagnosticTraceRecords.cs
- LinearKeyFrames.cs
- OuterProxyWrapper.cs
- Rotation3DKeyFrameCollection.cs
- SimpleHandlerFactory.cs
- AutomationInteropProvider.cs
- XmlSchemaSimpleTypeList.cs
- NullReferenceException.cs
- OdbcDataAdapter.cs
- Debug.cs
- IISMapPath.cs
- Button.cs
- CodeNamespaceImport.cs
- documentsequencetextpointer.cs
- SiteMapPathDesigner.cs
- PassportAuthenticationEventArgs.cs
- ExpandCollapsePattern.cs
- DataGridViewIntLinkedList.cs
- PrimitiveDataContract.cs
- __ComObject.cs
- MobileFormsAuthentication.cs
- Quaternion.cs
- CheckedPointers.cs
- TextModifier.cs
- WebExceptionStatus.cs
- PageWrapper.cs
- PathFigureCollection.cs
- WebExceptionStatus.cs
- DataAdapter.cs
- PriorityQueue.cs
- SymDocumentType.cs
- TreeIterator.cs
- OpCellTreeNode.cs
- SoapTypeAttribute.cs
- SkewTransform.cs
- PersonalizationDictionary.cs
- ConfigXmlElement.cs
- Vector3DAnimationUsingKeyFrames.cs
- CodeSubDirectoriesCollection.cs
- PhoneCall.cs
- Point3DCollectionValueSerializer.cs
- XmlStreamNodeWriter.cs
- BaseHashHelper.cs
- TypeConverterHelper.cs
- Comparer.cs
- InputGestureCollection.cs
- CompiledRegexRunnerFactory.cs
- IdnMapping.cs
- HttpApplicationFactory.cs
- ExtentKey.cs
- BitmapEffectInput.cs
- UrlPath.cs
- XmlSubtreeReader.cs
- Serializer.cs
- FlagsAttribute.cs
- StreamGeometry.cs
- IISMapPath.cs
- Rect3D.cs
- CreateBookmarkScope.cs
- AccessViolationException.cs
- Literal.cs
- CommonRemoteMemoryBlock.cs
- SmiContext.cs
- WebBrowserNavigatedEventHandler.cs
- MetadataUtilsSmi.cs