Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DesignerDataRelationship.cs
- WSDualHttpSecurityMode.cs
- HScrollBar.cs
- KeyFrames.cs
- TextDecorations.cs
- GroupQuery.cs
- AttributeUsageAttribute.cs
- FontNameEditor.cs
- IsolatedStorageFileStream.cs
- ToolStripContentPanel.cs
- SqlError.cs
- LocalFileSettingsProvider.cs
- TypefaceMetricsCache.cs
- InfoCardBaseException.cs
- OrderedEnumerableRowCollection.cs
- StorageAssociationTypeMapping.cs
- CodeAccessPermission.cs
- Figure.cs
- XmlSchemas.cs
- X509ScopedServiceCertificateElementCollection.cs
- TriggerActionCollection.cs
- StringExpressionSet.cs
- MetadataArtifactLoaderResource.cs
- NotSupportedException.cs
- VariantWrapper.cs
- InvalidOleVariantTypeException.cs
- Bitmap.cs
- UnhandledExceptionEventArgs.cs
- ObjectSpanRewriter.cs
- ListViewCommandEventArgs.cs
- DescriptionAttribute.cs
- MetadataArtifactLoader.cs
- ManagedIStream.cs
- ErrorEventArgs.cs
- XmlDataImplementation.cs
- DoubleCollectionConverter.cs
- AsyncContentLoadedEventArgs.cs
- ThicknessAnimation.cs
- SecurityUtils.cs
- DES.cs
- ButtonBase.cs
- Optimizer.cs
- wmiprovider.cs
- RelationshipManager.cs
- RuleDefinitions.cs
- LogicalExpressionEditor.cs
- SystemTcpConnection.cs
- QilExpression.cs
- OperatingSystem.cs
- BasicCellRelation.cs
- CriticalFinalizerObject.cs
- DebugInfoExpression.cs
- bidPrivateBase.cs
- DirectoryInfo.cs
- SessionEndingCancelEventArgs.cs
- GeometryDrawing.cs
- SSmlParser.cs
- PasswordBox.cs
- PropertyEntry.cs
- CryptoKeySecurity.cs
- MultiSelector.cs
- AuthenticationService.cs
- SoapReflectionImporter.cs
- EnumUnknown.cs
- AxisAngleRotation3D.cs
- SiteMap.cs
- IOException.cs
- PasswordTextNavigator.cs
- DeclarationUpdate.cs
- XpsS0ValidatingLoader.cs
- Int32RectConverter.cs
- CollectionConverter.cs
- GridViewHeaderRowPresenter.cs
- XhtmlTextWriter.cs
- SoapHeaderException.cs
- FixedBufferAttribute.cs
- FixedDocumentPaginator.cs
- Rotation3D.cs
- SmiEventSink_DeferedProcessing.cs
- HttpRawResponse.cs
- ExpressionVisitor.cs
- SocketException.cs
- SmuggledIUnknown.cs
- AttachInfo.cs
- LocalBuilder.cs
- TreeNodeBinding.cs
- XPathSelectionIterator.cs
- ChangePassword.cs
- Button.cs
- SystemResourceKey.cs
- XmlValidatingReaderImpl.cs
- AttributeUsageAttribute.cs
- SrgsRule.cs
- ToolStripSeparatorRenderEventArgs.cs
- StyleXamlParser.cs
- SmiRecordBuffer.cs
- DataIdProcessor.cs
- SqlDataSourceConfigureSortForm.cs
- TextProperties.cs
- ProtocolsConfiguration.cs