Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SafeLocalAllocation.cs
- serverconfig.cs
- CustomDictionarySources.cs
- PrintControllerWithStatusDialog.cs
- ControlValuePropertyAttribute.cs
- NamedPipeAppDomainProtocolHandler.cs
- diagnosticsswitches.cs
- securitycriticaldata.cs
- TabItem.cs
- MsmqInputSessionChannelListener.cs
- URI.cs
- Activity.cs
- Stopwatch.cs
- LoginName.cs
- ExtendedPropertyCollection.cs
- Int32Rect.cs
- SqlCacheDependencySection.cs
- WindowsNonControl.cs
- LowerCaseStringConverter.cs
- XmlExtensionFunction.cs
- ActivityBuilderHelper.cs
- Lasso.cs
- MergeFilterQuery.cs
- ReadContentAsBinaryHelper.cs
- SystemFonts.cs
- GatewayIPAddressInformationCollection.cs
- AssemblyNameProxy.cs
- ToolStripDropDownButton.cs
- WebSysDescriptionAttribute.cs
- ResXResourceReader.cs
- DES.cs
- RTLAwareMessageBox.cs
- XmlChildNodes.cs
- PasswordBox.cs
- figurelength.cs
- XhtmlBasicControlAdapter.cs
- ScaleTransform3D.cs
- CookieParameter.cs
- _NTAuthentication.cs
- SettingsPropertyValue.cs
- XmlSerializationReader.cs
- ImageClickEventArgs.cs
- FormsAuthenticationModule.cs
- EndpointIdentityConverter.cs
- WebPartCatalogCloseVerb.cs
- ValueProviderWrapper.cs
- DataServices.cs
- ZipFileInfo.cs
- ResXResourceWriter.cs
- CodeMethodInvokeExpression.cs
- _SafeNetHandles.cs
- CodeTypeReferenceExpression.cs
- WriteTimeStream.cs
- SoapSchemaMember.cs
- CapiNative.cs
- HtmlInputControl.cs
- VisualStyleRenderer.cs
- SqlStream.cs
- LoginView.cs
- DataGridColumnEventArgs.cs
- EdmType.cs
- NotificationContext.cs
- XmlUrlResolver.cs
- Mutex.cs
- HttpClientCertificate.cs
- XmlSiteMapProvider.cs
- TextLineResult.cs
- StateDesigner.LayoutSelectionGlyph.cs
- TreeBuilderBamlTranslator.cs
- SocketElement.cs
- XmlStringTable.cs
- HideDisabledControlAdapter.cs
- SqlUtil.cs
- BamlBinaryReader.cs
- WpfMemberInvoker.cs
- SR.cs
- HitTestDrawingContextWalker.cs
- CompoundFileStreamReference.cs
- XmlSchemaAnnotated.cs
- OSEnvironmentHelper.cs
- ClientProxyGenerator.cs
- MessageQueueException.cs
- Control.cs
- NativeMethods.cs
- MarkupObject.cs
- BulletedListEventArgs.cs
- ContractUtils.cs
- BasicKeyConstraint.cs
- NetworkStream.cs
- ObjectStateManagerMetadata.cs
- XmlSignificantWhitespace.cs
- ResXResourceReader.cs
- PeerApplicationLaunchInfo.cs
- XhtmlCssHandler.cs
- FieldAccessException.cs
- SQLConvert.cs
- QueryOutputWriter.cs
- StateMachineDesignerPaint.cs
- ThreadInterruptedException.cs
- PointIndependentAnimationStorage.cs