Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Security.cs
- RankException.cs
- ListSortDescriptionCollection.cs
- TreeNodeBinding.cs
- NullableDecimalMinMaxAggregationOperator.cs
- TextAutomationPeer.cs
- XmlSerializableWriter.cs
- QuinticEase.cs
- TabControlEvent.cs
- SqlWorkflowPersistenceService.cs
- StylusPointDescription.cs
- DataGridAddNewRow.cs
- EUCJPEncoding.cs
- EmptyCollection.cs
- CurrencyManager.cs
- GridView.cs
- Parameter.cs
- XmlObjectSerializerReadContextComplexJson.cs
- NumericUpDownAccelerationCollection.cs
- InstallerTypeAttribute.cs
- PointCollectionConverter.cs
- AutomationTextAttribute.cs
- FileLoadException.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- GridToolTip.cs
- DbConnectionPoolOptions.cs
- AuthenticationConfig.cs
- RichListBox.cs
- ChunkedMemoryStream.cs
- PackagePart.cs
- SchemaElement.cs
- PreApplicationStartMethodAttribute.cs
- WebPartVerbsEventArgs.cs
- ResponseBodyWriter.cs
- MethodBuilderInstantiation.cs
- PackWebRequest.cs
- XmlStrings.cs
- Int64.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- WindowsTokenRoleProvider.cs
- CircleHotSpot.cs
- GraphicsContext.cs
- AttributeQuery.cs
- SerTrace.cs
- ServiceBuildProvider.cs
- ToolStripSettings.cs
- FlowNode.cs
- IOException.cs
- SafeThemeHandle.cs
- AnnotationComponentManager.cs
- SignatureHelper.cs
- EDesignUtil.cs
- MiniAssembly.cs
- EntityViewGenerationAttribute.cs
- CanonicalFontFamilyReference.cs
- JsonServiceDocumentSerializer.cs
- ViewCellRelation.cs
- XmlNullResolver.cs
- MergeLocalizationDirectives.cs
- DynamicResourceExtension.cs
- DotExpr.cs
- ConnectionConsumerAttribute.cs
- TemplateBamlTreeBuilder.cs
- ListViewGroup.cs
- ExtenderControl.cs
- DeliveryRequirementsAttribute.cs
- ExtendedPropertyDescriptor.cs
- ButtonBase.cs
- ImageMapEventArgs.cs
- DropDownList.cs
- DataGridViewCellStyleBuilderDialog.cs
- MarkupCompilePass2.cs
- XmlSignatureProperties.cs
- GradientStop.cs
- AttachmentCollection.cs
- SByteStorage.cs
- AdornerDecorator.cs
- DocumentApplicationJournalEntry.cs
- SmtpClient.cs
- TaiwanCalendar.cs
- DocumentManager.cs
- PageContentAsyncResult.cs
- SqlDataSourceCache.cs
- DataColumnMapping.cs
- TypedElement.cs
- ConfigurationSchemaErrors.cs
- QueryLifecycle.cs
- Type.cs
- DataSourceCache.cs
- ControlIdConverter.cs
- AutoGeneratedField.cs
- URIFormatException.cs
- InstancePersistenceCommandException.cs
- HttpPostedFile.cs
- DBBindings.cs
- SchemaImporterExtension.cs
- WebResourceUtil.cs
- StrokeCollection.cs
- SpellerInterop.cs
- XPathCompiler.cs