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
- LabelAutomationPeer.cs
- Graphics.cs
- PointKeyFrameCollection.cs
- SEHException.cs
- InternalUserCancelledException.cs
- AsyncOperationContext.cs
- LinkArea.cs
- ColorMatrix.cs
- ArgIterator.cs
- EntitySet.cs
- TypedAsyncResult.cs
- ColorInterpolationModeValidation.cs
- Token.cs
- TreeNodeCollection.cs
- KeyFrames.cs
- DetailsViewModeEventArgs.cs
- OdbcReferenceCollection.cs
- DataList.cs
- RefreshPropertiesAttribute.cs
- WebZoneDesigner.cs
- Repeater.cs
- JpegBitmapEncoder.cs
- LineInfo.cs
- SimpleWorkerRequest.cs
- RemoteWebConfigurationHostStream.cs
- WinFormsComponentEditor.cs
- ContextCorrelationInitializer.cs
- SqlClientMetaDataCollectionNames.cs
- XmlSchemaDatatype.cs
- BufferBuilder.cs
- InvalidEnumArgumentException.cs
- ReadOnlyTernaryTree.cs
- ApplicationServicesHostFactory.cs
- XPathNodePointer.cs
- ProcessHostServerConfig.cs
- SettingsPropertyCollection.cs
- ValuePatternIdentifiers.cs
- HttpWrapper.cs
- CustomValidator.cs
- XomlCompilerResults.cs
- EntityCommandCompilationException.cs
- TextCharacters.cs
- LabelEditEvent.cs
- PrtCap_Public.cs
- SystemInformation.cs
- PrinterUnitConvert.cs
- HttpAsyncResult.cs
- PassportPrincipal.cs
- CodeAssignStatement.cs
- NegationPusher.cs
- SizeChangedInfo.cs
- ScrollEventArgs.cs
- SoapObjectInfo.cs
- PageBreakRecord.cs
- SerializationException.cs
- StringUtil.cs
- CompareInfo.cs
- WindowsGrip.cs
- ShapingWorkspace.cs
- filewebrequest.cs
- GridViewEditEventArgs.cs
- QueryOperationResponseOfT.cs
- SrgsElementFactory.cs
- Column.cs
- DownloadProgressEventArgs.cs
- BitmapMetadataEnumerator.cs
- ServiceNameCollection.cs
- TdsParserStateObject.cs
- StringAttributeCollection.cs
- MinimizableAttributeTypeConverter.cs
- SequenceFullException.cs
- FixedDocumentSequencePaginator.cs
- PropertyIdentifier.cs
- QueryNode.cs
- AtomParser.cs
- UnsafeNativeMethods.cs
- SecurityContext.cs
- BitmapCodecInfo.cs
- X509RecipientCertificateServiceElement.cs
- MulticastIPAddressInformationCollection.cs
- DataGridViewCell.cs
- SystemFonts.cs
- GC.cs
- GroupQuery.cs
- EnumBuilder.cs
- ClipboardProcessor.cs
- XmlUtil.cs
- ShapeTypeface.cs
- DecimalConstantAttribute.cs
- GeneralTransformCollection.cs
- Simplifier.cs
- XmlLoader.cs
- PassportAuthentication.cs
- Storyboard.cs
- ContextMarshalException.cs
- DetailsViewCommandEventArgs.cs
- loginstatus.cs
- NamespaceCollection.cs
- X509ScopedServiceCertificateElement.cs
- XmlSchemaChoice.cs