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
- AspNetCompatibilityRequirementsMode.cs
- VisualStateGroup.cs
- ResourceContainer.cs
- FileLoadException.cs
- DataSysAttribute.cs
- LiteralText.cs
- LockedAssemblyCache.cs
- BitmapData.cs
- TdsValueSetter.cs
- TextEmbeddedObject.cs
- StoryFragments.cs
- FileDetails.cs
- CopyAction.cs
- GraphicsContainer.cs
- XmlSchemaIdentityConstraint.cs
- ParserHooks.cs
- WebPartVerbCollection.cs
- HtmlTextArea.cs
- ThreadExceptionEvent.cs
- Propagator.JoinPropagator.cs
- PeerInvitationResponse.cs
- XmlSchemaProviderAttribute.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- SupportsEventValidationAttribute.cs
- BinHexEncoding.cs
- PropagatorResult.cs
- BodyWriter.cs
- SystemInfo.cs
- CustomLineCap.cs
- HelloMessageApril2005.cs
- Profiler.cs
- OLEDB_Util.cs
- JoinTreeSlot.cs
- Win32KeyboardDevice.cs
- ModelTreeEnumerator.cs
- WebControlAdapter.cs
- QuestionEventArgs.cs
- ScrollPattern.cs
- XmlSchemaInferenceException.cs
- WindowHideOrCloseTracker.cs
- SimpleTypesSurrogate.cs
- WebOperationContext.cs
- ListViewGroupItemCollection.cs
- Subtree.cs
- UserControl.cs
- XmlNamespaceMapping.cs
- Debug.cs
- PackageFilter.cs
- FontDifferentiator.cs
- SimpleBitVector32.cs
- basecomparevalidator.cs
- PiiTraceSource.cs
- HttpFileCollection.cs
- WindowsListViewScroll.cs
- TypedDataSetSchemaImporterExtension.cs
- VerificationAttribute.cs
- MetadataCollection.cs
- SoapEnumAttribute.cs
- OleDbTransaction.cs
- SqlDataSourceCache.cs
- ProviderIncompatibleException.cs
- IPCCacheManager.cs
- XamlToRtfWriter.cs
- SecUtil.cs
- VisualCollection.cs
- ImageListUtils.cs
- ClientRoleProvider.cs
- NamespaceMapping.cs
- PKCS1MaskGenerationMethod.cs
- UserControlCodeDomTreeGenerator.cs
- PropertyItemInternal.cs
- TextFormatterHost.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ServiceContractGenerator.cs
- InfoCardKeyedHashAlgorithm.cs
- LayoutExceptionEventArgs.cs
- KoreanCalendar.cs
- AuthenticationConfig.cs
- XsltLoader.cs
- ActionFrame.cs
- EntityDataSource.cs
- BuildProvider.cs
- BaseProcessor.cs
- HtmlControl.cs
- WindowProviderWrapper.cs
- OleStrCAMarshaler.cs
- recordstate.cs
- DataGridViewComboBoxColumn.cs
- Configuration.cs
- WindowsServiceCredential.cs
- CookieHandler.cs
- DesignerDataStoredProcedure.cs
- RepeaterItem.cs
- ResourceExpressionBuilder.cs
- SqlInternalConnectionTds.cs
- OpenTypeLayoutCache.cs
- TypeElementCollection.cs
- StyleHelper.cs
- EmptyQuery.cs
- BuildProvider.cs