Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / DataObjectFieldAttribute.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripSplitStackLayout.cs
- ConnectionPoolManager.cs
- BatchServiceHost.cs
- WebServiceHandler.cs
- ObjectListCommandEventArgs.cs
- StreamSecurityUpgradeInitiator.cs
- compensatingcollection.cs
- XPathItem.cs
- LogFlushAsyncResult.cs
- FontStretchConverter.cs
- WindowInteractionStateTracker.cs
- EventArgs.cs
- DataGrid.cs
- ErrorHandlerFaultInfo.cs
- SuppressIldasmAttribute.cs
- XmlNamedNodeMap.cs
- Material.cs
- PenLineJoinValidation.cs
- Style.cs
- Token.cs
- UIAgentAsyncBeginRequest.cs
- BatchStream.cs
- EventOpcode.cs
- BitmapEffectRenderDataResource.cs
- AmbiguousMatchException.cs
- PagesChangedEventArgs.cs
- XsdBuildProvider.cs
- ProfileInfo.cs
- DataFieldEditor.cs
- DesigntimeLicenseContextSerializer.cs
- DPCustomTypeDescriptor.cs
- NavigatorOutput.cs
- TextEmbeddedObject.cs
- PointAnimationUsingPath.cs
- SecureStringHasher.cs
- Vector3D.cs
- SchemaImporterExtensionElement.cs
- IPipelineRuntime.cs
- RequestCacheValidator.cs
- Polygon.cs
- FieldMetadata.cs
- SQLDoubleStorage.cs
- MetadataHelper.cs
- WebUtil.cs
- XmlMembersMapping.cs
- NamedPermissionSet.cs
- ImageCodecInfoPrivate.cs
- User.cs
- PersonalizationProviderCollection.cs
- StrokeCollection2.cs
- LicFileLicenseProvider.cs
- PrincipalPermission.cs
- Transform.cs
- HttpGetProtocolReflector.cs
- FlowLayoutPanel.cs
- TraceFilter.cs
- ZipIOExtraFieldZip64Element.cs
- XmlSecureResolver.cs
- EmissiveMaterial.cs
- HashMembershipCondition.cs
- ParameterCollection.cs
- HeaderedContentControl.cs
- SetterBase.cs
- RolePrincipal.cs
- ManagementObjectSearcher.cs
- ColumnHeaderCollectionEditor.cs
- Transform3DGroup.cs
- SiteMapDataSourceView.cs
- APCustomTypeDescriptor.cs
- DefaultObjectSerializer.cs
- SurrogateEncoder.cs
- BindingListCollectionView.cs
- SectionVisual.cs
- MailDefinition.cs
- XmlDictionary.cs
- TreeNodeConverter.cs
- DataGridColumn.cs
- CommandValueSerializer.cs
- NavigationEventArgs.cs
- HtmlControlPersistable.cs
- ListBoxItemAutomationPeer.cs
- ImageList.cs
- HtmlForm.cs
- Emitter.cs
- OptimalBreakSession.cs
- CodeAttachEventStatement.cs
- ExplicitDiscriminatorMap.cs
- MetadataItem.cs
- AssertFilter.cs
- storepermission.cs
- CompilerScopeManager.cs
- WebPartMinimizeVerb.cs
- BookmarkEventArgs.cs
- TypeConverterAttribute.cs
- MulticastDelegate.cs
- OleDbCommandBuilder.cs
- TimerTable.cs
- KeyTimeConverter.cs
- SafeFileMappingHandle.cs
- BitSet.cs