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
- ResolveNameEventArgs.cs
- MsmqPoisonMessageException.cs
- COM2FontConverter.cs
- FrameworkTextComposition.cs
- _SpnDictionary.cs
- XmlSchemaCollection.cs
- CmsInterop.cs
- ForeignConstraint.cs
- CodeIdentifier.cs
- LinkedResourceCollection.cs
- RegexStringValidatorAttribute.cs
- ExpressionPrefixAttribute.cs
- GlyphTypeface.cs
- PasswordDeriveBytes.cs
- BooleanProjectedSlot.cs
- ShaderEffect.cs
- ZipIOCentralDirectoryBlock.cs
- ClassGenerator.cs
- ContractComponent.cs
- MergeFilterQuery.cs
- XomlCompilerResults.cs
- CLSCompliantAttribute.cs
- FormViewPageEventArgs.cs
- XmlQueryTypeFactory.cs
- FamilyTypefaceCollection.cs
- StretchValidation.cs
- SerializerDescriptor.cs
- NativeRightsManagementAPIsStructures.cs
- DataMemberConverter.cs
- Int32Rect.cs
- Int64KeyFrameCollection.cs
- EntityContainer.cs
- _AutoWebProxyScriptEngine.cs
- WindowsTokenRoleProvider.cs
- PerformanceCountersElement.cs
- ChoiceConverter.cs
- TemplateNameScope.cs
- ExpressionTable.cs
- BulletChrome.cs
- DBDataPermissionAttribute.cs
- ManagedIStream.cs
- Timer.cs
- ExpressionNode.cs
- ZipIOLocalFileHeader.cs
- CompressionTransform.cs
- WorkflowItemsPresenter.cs
- isolationinterop.cs
- RuntimeCompatibilityAttribute.cs
- ConfigurationValidatorBase.cs
- LogArchiveSnapshot.cs
- _BufferOffsetSize.cs
- Color.cs
- OleDbRowUpdatingEvent.cs
- ThreadStartException.cs
- XsdCachingReader.cs
- Path.cs
- PasswordRecovery.cs
- MultipartContentParser.cs
- CompositeScriptReference.cs
- AsyncWaitHandle.cs
- ReflectionPermission.cs
- Zone.cs
- VisualStyleElement.cs
- Flowchart.cs
- UserPreferenceChangedEventArgs.cs
- CacheEntry.cs
- DefaultBinder.cs
- OpenFileDialog.cs
- SqlRewriteScalarSubqueries.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- XmlSerializerFactory.cs
- HttpCachePolicy.cs
- SubtreeProcessor.cs
- SystemIPInterfaceProperties.cs
- DbConnectionPoolOptions.cs
- RectangleGeometry.cs
- StrongName.cs
- MergeFailedEvent.cs
- EmptyControlCollection.cs
- RoleGroupCollection.cs
- connectionpool.cs
- ConnectionManagementElementCollection.cs
- BidPrivateBase.cs
- UnauthorizedAccessException.cs
- XmlTextReaderImpl.cs
- MetadataUtilsSmi.cs
- Floater.cs
- XhtmlTextWriter.cs
- StringToken.cs
- Matrix.cs
- XmlSchemaCompilationSettings.cs
- MethodCallTranslator.cs
- AsmxEndpointPickerExtension.cs
- ObjectDataSourceEventArgs.cs
- HostedImpersonationContext.cs
- StringCollectionEditor.cs
- Parameter.cs
- State.cs
- DetectRunnableInstancesTask.cs
- HostProtectionPermission.cs