Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataBinder.cs
- TableLayout.cs
- ColorMatrix.cs
- Stacktrace.cs
- ImageMap.cs
- VariableModifiersHelper.cs
- DeflateEmulationStream.cs
- ReceiveActivity.cs
- BackStopAuthenticationModule.cs
- SHA384.cs
- NodeInfo.cs
- IPPacketInformation.cs
- StorageTypeMapping.cs
- EnumerableRowCollection.cs
- TextServicesDisplayAttribute.cs
- exports.cs
- SystemInfo.cs
- AdornerLayer.cs
- HostVisual.cs
- DSACryptoServiceProvider.cs
- Single.cs
- DesignDataSource.cs
- SQLBoolean.cs
- ResXResourceSet.cs
- DataServicePagingProviderWrapper.cs
- ADRoleFactory.cs
- IPAddress.cs
- AsyncResult.cs
- NameSpaceExtractor.cs
- X509UI.cs
- ToolStripContainer.cs
- XmlSchemaAppInfo.cs
- GraphicsContext.cs
- DecimalFormatter.cs
- Triplet.cs
- ControlParameter.cs
- Single.cs
- FlowLayout.cs
- EmptyElement.cs
- BulletDecorator.cs
- RectangleF.cs
- BaseCAMarshaler.cs
- ServiceChannelFactory.cs
- SendActivityDesigner.cs
- SafeThreadHandle.cs
- ValueProviderWrapper.cs
- _LocalDataStore.cs
- HttpWebResponse.cs
- OracleEncoding.cs
- HttpDictionary.cs
- SystemFonts.cs
- MembershipPasswordException.cs
- XmlSchemaExporter.cs
- FeatureManager.cs
- MbpInfo.cs
- ListBoxItem.cs
- SyndicationSerializer.cs
- Helper.cs
- SqlColumnizer.cs
- ResourceKey.cs
- EntityModelSchemaGenerator.cs
- ComplexBindingPropertiesAttribute.cs
- MergeFailedEvent.cs
- MappingMetadataHelper.cs
- XLinq.cs
- Bold.cs
- TemplatePagerField.cs
- XpsThumbnail.cs
- NetNamedPipeSecurityElement.cs
- ValuePattern.cs
- MergablePropertyAttribute.cs
- ToolStripRenderEventArgs.cs
- AliasedExpr.cs
- HttpInputStream.cs
- PropertyTabChangedEvent.cs
- FileAuthorizationModule.cs
- __ComObject.cs
- ExceptionHelpers.cs
- XmlWrappingReader.cs
- ObfuscationAttribute.cs
- ResolvedKeyFrameEntry.cs
- SecurityElement.cs
- HScrollProperties.cs
- TextEditor.cs
- DataPagerFieldCommandEventArgs.cs
- BuildManager.cs
- Rect.cs
- TextModifierScope.cs
- Bidi.cs
- SystemBrushes.cs
- AppliedDeviceFiltersEditor.cs
- Enum.cs
- ProfilePropertyNameValidator.cs
- CombinedGeometry.cs
- GridViewPageEventArgs.cs
- SessionParameter.cs
- PackageDigitalSignature.cs
- handlecollector.cs
- IsolatedStorageException.cs
- ShapingWorkspace.cs