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
- OdbcInfoMessageEvent.cs
- DataPagerFieldItem.cs
- BigInt.cs
- SafeHandle.cs
- SqlClientMetaDataCollectionNames.cs
- Relationship.cs
- PersonalizationState.cs
- ComponentGlyph.cs
- ipaddressinformationcollection.cs
- OneOf.cs
- CodeCommentStatementCollection.cs
- _HTTPDateParse.cs
- CaseStatement.cs
- Visual3D.cs
- DataGridViewCellValueEventArgs.cs
- StrongBox.cs
- StringToken.cs
- DataGridViewCellStyleBuilderDialog.cs
- UpdateManifestForBrowserApplication.cs
- XmlSerializerVersionAttribute.cs
- ForeignKeyConstraint.cs
- URLMembershipCondition.cs
- DataControlImageButton.cs
- SubqueryRules.cs
- GenericParameterDataContract.cs
- AttributeCollection.cs
- MessageBodyMemberAttribute.cs
- TriggerCollection.cs
- XmlHierarchicalEnumerable.cs
- Dump.cs
- ToolStripDropDownMenu.cs
- AssemblyBuilderData.cs
- OverflowException.cs
- SoapDocumentServiceAttribute.cs
- ConfigurationPermission.cs
- CalendarButtonAutomationPeer.cs
- CommandLineParser.cs
- SafeHandle.cs
- ProcessThread.cs
- SiteMapPath.cs
- XmlSchemaFacet.cs
- dsa.cs
- StylusEditingBehavior.cs
- Point3DValueSerializer.cs
- ObjectNavigationPropertyMapping.cs
- CryptoConfig.cs
- VirtualDirectoryMappingCollection.cs
- RequestFactory.cs
- LocalizableResourceBuilder.cs
- XmlBoundElement.cs
- FileDialogCustomPlacesCollection.cs
- QueueProcessor.cs
- PerspectiveCamera.cs
- CommonDialog.cs
- AsymmetricKeyExchangeDeformatter.cs
- validationstate.cs
- ScriptingJsonSerializationSection.cs
- SQLMoney.cs
- ConnectionsZone.cs
- CompositionDesigner.cs
- SignedPkcs7.cs
- Baml2006KnownTypes.cs
- UIElementIsland.cs
- DesignTimeTemplateParser.cs
- WebPartPersonalization.cs
- ObjectStorage.cs
- SymmetricSecurityProtocolFactory.cs
- BaseConfigurationRecord.cs
- IntellisenseTextBox.designer.cs
- PathFigureCollectionValueSerializer.cs
- Connector.xaml.cs
- SponsorHelper.cs
- DataTemplateKey.cs
- WMIGenerator.cs
- ViewValidator.cs
- WebPartConnectionsConfigureVerb.cs
- ToolstripProfessionalRenderer.cs
- DbParameterHelper.cs
- FlowNode.cs
- SyndicationDeserializer.cs
- BamlBinaryReader.cs
- EndpointBehaviorElementCollection.cs
- StringUtil.cs
- ChangeProcessor.cs
- SourceChangedEventArgs.cs
- StretchValidation.cs
- CmsUtils.cs
- ResolveNextArgumentWorkItem.cs
- TextSimpleMarkerProperties.cs
- MaterializeFromAtom.cs
- RijndaelManagedTransform.cs
- BindingContext.cs
- CodeLabeledStatement.cs
- KeyPullup.cs
- SemanticAnalyzer.cs
- DataGridViewRowCollection.cs
- CultureMapper.cs
- SendKeys.cs
- SqlBooleanMismatchVisitor.cs
- ThaiBuddhistCalendar.cs