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
- CachingHintValidation.cs
- StructuralType.cs
- BaseTemplateCodeDomTreeGenerator.cs
- StrokeNodeOperations.cs
- MobileControlPersister.cs
- AppModelKnownContentFactory.cs
- X509ChainElement.cs
- NameObjectCollectionBase.cs
- HashMembershipCondition.cs
- wgx_exports.cs
- MembershipValidatePasswordEventArgs.cs
- ToolStripContentPanelDesigner.cs
- mediaeventargs.cs
- SchemaNames.cs
- Int32KeyFrameCollection.cs
- SqlDelegatedTransaction.cs
- SequentialUshortCollection.cs
- Literal.cs
- C14NUtil.cs
- KeyGesture.cs
- HttpListener.cs
- HtmlInputCheckBox.cs
- ClipboardProcessor.cs
- GridViewUpdateEventArgs.cs
- XmlEncodedRawTextWriter.cs
- ServiceElementCollection.cs
- BufferedReadStream.cs
- HyperlinkAutomationPeer.cs
- XamlReader.cs
- PropertyValidationContext.cs
- mda.cs
- WinEventQueueItem.cs
- JsonServiceDocumentSerializer.cs
- _FtpDataStream.cs
- RegexCode.cs
- MSAAEventDispatcher.cs
- PropertyIDSet.cs
- EdmSchemaAttribute.cs
- ResourceDefaultValueAttribute.cs
- ProtectedConfiguration.cs
- Border.cs
- PolyBezierSegmentFigureLogic.cs
- CallbackHandler.cs
- DecimalConstantAttribute.cs
- LinqDataSourceInsertEventArgs.cs
- DecimalSumAggregationOperator.cs
- WebPartPersonalization.cs
- ToolStripDropDownClosedEventArgs.cs
- PointF.cs
- OdbcConnectionPoolProviderInfo.cs
- EntityDataSourceValidationException.cs
- CompoundFileStreamReference.cs
- XmlSortKeyAccumulator.cs
- TextFragmentEngine.cs
- BamlLocalizableResourceKey.cs
- TypeSemantics.cs
- PerformanceCounterManager.cs
- HttpDebugHandler.cs
- Typeface.cs
- DataPointer.cs
- Debug.cs
- DodSequenceMerge.cs
- SynchronizedDispatch.cs
- controlskin.cs
- XmlAttributes.cs
- XmlValueConverter.cs
- XmlIterators.cs
- SafePointer.cs
- CommentEmitter.cs
- XDRSchema.cs
- CreateUserWizard.cs
- EntityDataSourceMemberPath.cs
- AnimatedTypeHelpers.cs
- _NegotiateClient.cs
- StylusShape.cs
- XmlUrlResolver.cs
- FragmentQueryKB.cs
- unsafeIndexingFilterStream.cs
- TextClipboardData.cs
- GradientStop.cs
- CheckPair.cs
- MetaType.cs
- ImageIndexEditor.cs
- ErrorRuntimeConfig.cs
- PreviewPageInfo.cs
- IntellisenseTextBox.cs
- CodeNamespaceCollection.cs
- BooleanAnimationUsingKeyFrames.cs
- ImageListStreamer.cs
- SQLGuidStorage.cs
- BamlWriter.cs
- FullTextState.cs
- LocatorBase.cs
- Win32Native.cs
- SplitContainer.cs
- ExeContext.cs
- SrgsDocumentParser.cs
- ITreeGenerator.cs
- Brush.cs
- CodeVariableReferenceExpression.cs