Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- FormatConvertedBitmap.cs
- RepeatInfo.cs
- RowUpdatedEventArgs.cs
- _WebProxyDataBuilder.cs
- EditingCoordinator.cs
- BufferedReadStream.cs
- WebPartVerbCollection.cs
- FileSecurity.cs
- GatewayDefinition.cs
- CompiledELinqQueryState.cs
- ErrorReporting.cs
- ConversionHelper.cs
- GenericWebPart.cs
- PropertyGridEditorPart.cs
- DeclarativeExpressionConditionDeclaration.cs
- MenuItem.cs
- FontNamesConverter.cs
- Guid.cs
- CaseInsensitiveOrdinalStringComparer.cs
- SequenceDesigner.cs
- LocalizedNameDescriptionPair.cs
- SigningCredentials.cs
- BamlVersionHeader.cs
- RangeValuePattern.cs
- BitVector32.cs
- WeakEventTable.cs
- XmlElementAttribute.cs
- BindingGraph.cs
- GeometryHitTestResult.cs
- MaterialGroup.cs
- WebPartTransformerAttribute.cs
- Label.cs
- BackgroundFormatInfo.cs
- LinqDataSourceStatusEventArgs.cs
- UnsafeNativeMethodsMilCoreApi.cs
- XmlDataSourceView.cs
- TrustVersion.cs
- UndoManager.cs
- TreeNodeBindingCollection.cs
- Parser.cs
- AtomServiceDocumentSerializer.cs
- TreeIterator.cs
- XhtmlBasicImageAdapter.cs
- HijriCalendar.cs
- ScrollEvent.cs
- SolidColorBrush.cs
- UInt16.cs
- ITreeGenerator.cs
- QilValidationVisitor.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- AnalyzedTree.cs
- UIElementIsland.cs
- NamespaceList.cs
- TaskFileService.cs
- AuthenticationModuleElementCollection.cs
- XmlSchemaAll.cs
- XMLUtil.cs
- Clause.cs
- GuidTagList.cs
- PointHitTestResult.cs
- SerializationEventsCache.cs
- RegexGroupCollection.cs
- GreenMethods.cs
- WindowsTokenRoleProvider.cs
- WindowsEditBox.cs
- DocumentPaginator.cs
- ExpressionBindingCollection.cs
- SpellCheck.cs
- RtfToken.cs
- XmlReflectionImporter.cs
- EventWaitHandle.cs
- SmiXetterAccessMap.cs
- GlobalEventManager.cs
- BooleanSwitch.cs
- ConfigurationStrings.cs
- VariantWrapper.cs
- SymDocumentType.cs
- IisTraceListener.cs
- OleDbFactory.cs
- TextComposition.cs
- _IPv4Address.cs
- ThreadExceptionDialog.cs
- ResourcesBuildProvider.cs
- ViewGenerator.cs
- WindowsListBox.cs
- TableRowCollection.cs
- OdbcStatementHandle.cs
- PolicyVersionConverter.cs
- FontFamily.cs
- CommandBinding.cs
- EasingKeyFrames.cs
- TextInfo.cs
- SHA512Managed.cs
- OSFeature.cs
- EventSetterHandlerConverter.cs
- Exceptions.cs
- ResourceReferenceExpressionConverter.cs
- TransformerConfigurationWizardBase.cs
- AssociationSetMetadata.cs
- TextRenderingModeValidation.cs