Code:
/ DotNET / DotNET / 8.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
- TreeViewEvent.cs
- TypeValidationEventArgs.cs
- KerberosRequestorSecurityToken.cs
- ResourcePermissionBase.cs
- SafeViewOfFileHandle.cs
- CustomLineCap.cs
- ToolStripSettings.cs
- FrugalList.cs
- ReferenceService.cs
- HtmlDocument.cs
- TypeInformation.cs
- WebConfigurationHost.cs
- ToolStripItemDesigner.cs
- PrefixHandle.cs
- ControlPaint.cs
- X509CertificateCollection.cs
- Utils.cs
- DuplicateWaitObjectException.cs
- XmlDocument.cs
- StringSource.cs
- Hex.cs
- Zone.cs
- ToolboxCategory.cs
- SyndicationSerializer.cs
- AsyncContentLoadedEventArgs.cs
- ClientApiGenerator.cs
- XmlQueryTypeFactory.cs
- BitmapEncoder.cs
- BitmapEffect.cs
- ToolStripSeparator.cs
- WebPageTraceListener.cs
- IxmlLineInfo.cs
- CustomPopupPlacement.cs
- DesignConnection.cs
- DataGridViewComboBoxColumn.cs
- XmlSchemaDocumentation.cs
- Rule.cs
- ThemeableAttribute.cs
- coordinatorfactory.cs
- GenericIdentity.cs
- EntityViewGenerator.cs
- SiteMapNodeItemEventArgs.cs
- SelfIssuedAuthProofToken.cs
- StrokeDescriptor.cs
- UInt64.cs
- BoundField.cs
- Globals.cs
- XmlDeclaration.cs
- DataRelationCollection.cs
- ToggleProviderWrapper.cs
- DataBoundControlAdapter.cs
- DataTable.cs
- ACE.cs
- GrammarBuilder.cs
- TableLayoutRowStyleCollection.cs
- AppDomainProtocolHandler.cs
- ClassValidator.cs
- ResourceManager.cs
- PaperSize.cs
- SynthesizerStateChangedEventArgs.cs
- WizardSideBarListControlItemEventArgs.cs
- MemberExpression.cs
- MultipleFilterMatchesException.cs
- QilTypeChecker.cs
- SqlReferenceCollection.cs
- StreamResourceInfo.cs
- UnsafeNetInfoNativeMethods.cs
- EntityDataSourceSelectedEventArgs.cs
- RegexReplacement.cs
- WriteTimeStream.cs
- DataGridCell.cs
- SafeTimerHandle.cs
- AppDomainUnloadedException.cs
- DbProviderFactory.cs
- DbXmlEnabledProviderManifest.cs
- DataComponentGenerator.cs
- DaylightTime.cs
- BinaryFormatterWriter.cs
- SQLInt32Storage.cs
- EUCJPEncoding.cs
- AppDomain.cs
- ServiceNameElementCollection.cs
- CancelEventArgs.cs
- LogRestartAreaEnumerator.cs
- MasterPageBuildProvider.cs
- RequestQueryProcessor.cs
- ButtonPopupAdapter.cs
- Int64.cs
- ExpandCollapseProviderWrapper.cs
- GACIdentityPermission.cs
- TimeoutValidationAttribute.cs
- OpCodes.cs
- QuaternionAnimation.cs
- Highlights.cs
- Utils.cs
- WindowsScrollBar.cs
- SerializationSectionGroup.cs
- PrintEvent.cs
- ACL.cs
- SafeThemeHandle.cs