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
- CleanUpVirtualizedItemEventArgs.cs
- EndpointAddressMessageFilter.cs
- BufferedStream.cs
- IRCollection.cs
- SHA512Managed.cs
- ListManagerBindingsCollection.cs
- hresults.cs
- PageCache.cs
- AnimationStorage.cs
- SynchronousReceiveElement.cs
- AmbientValueAttribute.cs
- ValidationResult.cs
- HealthMonitoringSectionHelper.cs
- ConfigurationException.cs
- XmlDocument.cs
- ResourceSet.cs
- Int64.cs
- XmlSchemaCollection.cs
- BinaryFormatterWriter.cs
- TabItemWrapperAutomationPeer.cs
- WinEventTracker.cs
- EntityProviderServices.cs
- Parsers.cs
- ConfigurationStrings.cs
- BindingExpressionUncommonField.cs
- RuntimeHandles.cs
- GAC.cs
- CompilerTypeWithParams.cs
- HMACSHA384.cs
- WindowsAuthenticationModule.cs
- RequestCachePolicyConverter.cs
- DependencyPropertyDescriptor.cs
- AmbiguousMatchException.cs
- InteropAutomationProvider.cs
- RelatedCurrencyManager.cs
- HostProtectionPermission.cs
- UIElement.cs
- BitmapCodecInfoInternal.cs
- AvtEvent.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- Object.cs
- ResourceSet.cs
- SessionState.cs
- SolidBrush.cs
- InteropBitmapSource.cs
- InlineUIContainer.cs
- ipaddressinformationcollection.cs
- DataGridViewColumnCollection.cs
- TextBlockAutomationPeer.cs
- InputProcessorProfilesLoader.cs
- _PooledStream.cs
- Compress.cs
- ContentValidator.cs
- SqlBooleanMismatchVisitor.cs
- XmlSchemaAttribute.cs
- ManagementOperationWatcher.cs
- Geometry3D.cs
- Baml2006KnownTypes.cs
- AssemblyAttributesGoHere.cs
- ToolBarButtonDesigner.cs
- HotSpotCollection.cs
- DataIdProcessor.cs
- PageAdapter.cs
- RightsManagementEncryptedStream.cs
- TextDocumentView.cs
- XmlArrayAttribute.cs
- UshortList2.cs
- Constants.cs
- HtmlTable.cs
- HtmlGenericControl.cs
- SerializerWriterEventHandlers.cs
- NamedPermissionSet.cs
- GridViewCancelEditEventArgs.cs
- HideDisabledControlAdapter.cs
- LinkButton.cs
- SerTrace.cs
- XmlStreamNodeWriter.cs
- PackUriHelper.cs
- messageonlyhwndwrapper.cs
- FileDialog.cs
- SqlDataAdapter.cs
- ExtenderProvidedPropertyAttribute.cs
- SlipBehavior.cs
- TextRenderingModeValidation.cs
- SafeMILHandle.cs
- XPathNodeHelper.cs
- EmptyEnumerable.cs
- AppDomainManager.cs
- ListView.cs
- FormsIdentity.cs
- HTMLTextWriter.cs
- AndCondition.cs
- GridItemCollection.cs
- DataGridCommandEventArgs.cs
- TableCellCollection.cs
- parserscommon.cs
- GradientStopCollection.cs
- HtmlEncodedRawTextWriter.cs
- Activity.cs
- WindowShowOrOpenTracker.cs