Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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(); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeExtension.cs
- Rect3DValueSerializer.cs
- FontNameEditor.cs
- ReversePositionQuery.cs
- XmlSchemaSequence.cs
- CodeBlockBuilder.cs
- RuleSettings.cs
- DayRenderEvent.cs
- ThreadStaticAttribute.cs
- UIElement3D.cs
- UpdatePanel.cs
- InnerItemCollectionView.cs
- NetTcpBindingElement.cs
- DataGridColumnFloatingHeader.cs
- ThreadLocal.cs
- DispatcherFrame.cs
- ReturnEventArgs.cs
- LOSFormatter.cs
- ConnectionConsumerAttribute.cs
- XsltArgumentList.cs
- DbInsertCommandTree.cs
- DesignerVerbCollection.cs
- EndpointInfo.cs
- TreeIterators.cs
- FixedSOMTextRun.cs
- HttpProxyCredentialType.cs
- RichTextBox.cs
- MediaElement.cs
- WebBrowserHelper.cs
- CodeStatementCollection.cs
- PenThreadPool.cs
- TextEffect.cs
- XmlSerializerAssemblyAttribute.cs
- TextBoxBase.cs
- SQLMembershipProvider.cs
- TerminatorSinks.cs
- InputLanguageProfileNotifySink.cs
- MaskedTextBox.cs
- StaticExtension.cs
- Predicate.cs
- CqlLexerHelpers.cs
- DataBoundControlAdapter.cs
- NavigatorInput.cs
- ExtensionElement.cs
- LicenseException.cs
- DataGridViewIntLinkedList.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- BitmapCache.cs
- BindingExpressionUncommonField.cs
- Rijndael.cs
- ImageAutomationPeer.cs
- TableLayoutSettings.cs
- ExportException.cs
- BasePropertyDescriptor.cs
- SchemaElement.cs
- GridViewCellAutomationPeer.cs
- TextRunCacheImp.cs
- IHttpResponseInternal.cs
- XPathNavigatorKeyComparer.cs
- KeyValueConfigurationCollection.cs
- LinqDataSourceHelper.cs
- TablePattern.cs
- MessageSecurityVersionConverter.cs
- TreeNodeBindingCollection.cs
- SoapMessage.cs
- DataGridAutoFormat.cs
- EventArgs.cs
- HttpListenerResponse.cs
- Drawing.cs
- DeclarativeCatalogPart.cs
- StringFunctions.cs
- AdornedElementPlaceholder.cs
- GridToolTip.cs
- IIS7UserPrincipal.cs
- LabelEditEvent.cs
- ByteRangeDownloader.cs
- ConfigurationErrorsException.cs
- WebControlAdapter.cs
- AppDomainAttributes.cs
- MarshalByValueComponent.cs
- TypefaceMetricsCache.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- SqlConnectionManager.cs
- WmpBitmapEncoder.cs
- MetadataWorkspace.cs
- AppDomainShutdownMonitor.cs
- RawStylusSystemGestureInputReport.cs
- itemelement.cs
- RelationshipManager.cs
- PathParser.cs
- HttpListenerRequest.cs
- EndpointInfo.cs
- DataPagerFieldItem.cs
- DocComment.cs
- ExpressionBinding.cs
- HostedTransportConfigurationManager.cs
- ToolStripContentPanel.cs
- CryptoApi.cs
- LambdaCompiler.Lambda.cs
- XmlDigitalSignatureProcessor.cs