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
- XmlSerializationReader.cs
- SubqueryRules.cs
- PathSegment.cs
- ListViewSortEventArgs.cs
- SudsWriter.cs
- ThreadInterruptedException.cs
- DataGridCellAutomationPeer.cs
- WinFormsSpinner.cs
- FocusTracker.cs
- CompoundFileReference.cs
- EmptyCollection.cs
- SqlClientFactory.cs
- WinInet.cs
- StateDesigner.LayoutSelectionGlyph.cs
- TabletCollection.cs
- AssociationSet.cs
- Activator.cs
- Track.cs
- Polyline.cs
- WpfPayload.cs
- SmtpFailedRecipientException.cs
- CoTaskMemSafeHandle.cs
- EventSetterHandlerConverter.cs
- FileUtil.cs
- ScrollViewer.cs
- SafeRightsManagementHandle.cs
- ViewStateModeByIdAttribute.cs
- FastEncoderWindow.cs
- StoragePropertyMapping.cs
- ByteAnimationBase.cs
- ConnectionInterfaceCollection.cs
- Point3D.cs
- SqlError.cs
- SignedInfo.cs
- ForEachAction.cs
- BezierSegment.cs
- AutomationEventArgs.cs
- DataKeyCollection.cs
- SectionUpdates.cs
- DocumentReference.cs
- SmtpNegotiateAuthenticationModule.cs
- PrintPageEvent.cs
- NTAccount.cs
- HashCodeCombiner.cs
- SchemaTableOptionalColumn.cs
- bindurihelper.cs
- MimeFormReflector.cs
- ScriptRegistrationManager.cs
- HttpListenerRequest.cs
- DependencyProperty.cs
- GuidConverter.cs
- WindowsTokenRoleProvider.cs
- Hashtable.cs
- ColorConvertedBitmap.cs
- OracleCommandSet.cs
- ApplicationCommands.cs
- Vector3DCollectionValueSerializer.cs
- HMACSHA384.cs
- XmlMemberMapping.cs
- KeySplineConverter.cs
- Ray3DHitTestResult.cs
- WrappingXamlSchemaContext.cs
- TrackingProfileCache.cs
- MouseActionConverter.cs
- StylusPointPropertyInfoDefaults.cs
- XmlResolver.cs
- ReachDocumentReferenceCollectionSerializer.cs
- BrowserTree.cs
- HtmlEncodedRawTextWriter.cs
- DataServiceQuery.cs
- StyleCollectionEditor.cs
- ComEventsSink.cs
- ConstantProjectedSlot.cs
- CodeRemoveEventStatement.cs
- IdentityHolder.cs
- ZipIOExtraFieldPaddingElement.cs
- WebServiceResponseDesigner.cs
- WebDisplayNameAttribute.cs
- RecipientInfo.cs
- __Error.cs
- Cursor.cs
- MissingSatelliteAssemblyException.cs
- NavigationFailedEventArgs.cs
- LoginNameDesigner.cs
- DataSourceProvider.cs
- COM2TypeInfoProcessor.cs
- ImageIndexConverter.cs
- RegexReplacement.cs
- ValueOfAction.cs
- Merger.cs
- ObjectDataSourceDisposingEventArgs.cs
- UInt16.cs
- BrowserCapabilitiesFactoryBase.cs
- UnaryNode.cs
- AstTree.cs
- StorageBasedPackageProperties.cs
- TransactionProxy.cs
- ellipse.cs
- FormParameter.cs
- RegexCharClass.cs