Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- StoreItemCollection.Loader.cs
- TypeDependencyAttribute.cs
- DataGridViewDataErrorEventArgs.cs
- BinaryExpression.cs
- _SslSessionsCache.cs
- ContentPlaceHolder.cs
- StringReader.cs
- BlobPersonalizationState.cs
- LogicalExpressionTypeConverter.cs
- IISUnsafeMethods.cs
- IdentityHolder.cs
- MarshalDirectiveException.cs
- ListBoxChrome.cs
- XmlSchemaGroup.cs
- DrawListViewSubItemEventArgs.cs
- Popup.cs
- Matrix3D.cs
- ErrorsHelper.cs
- ItemType.cs
- CurrencyManager.cs
- SamlDoNotCacheCondition.cs
- StateValidator.cs
- GlyphCollection.cs
- LookupNode.cs
- FixedDocument.cs
- SignerInfo.cs
- SafeWaitHandle.cs
- JoinElimination.cs
- PointCollection.cs
- InstanceDataCollectionCollection.cs
- DbDeleteCommandTree.cs
- WindowsHyperlink.cs
- QueryMath.cs
- ProcessModelSection.cs
- GeneralTransform3DTo2DTo3D.cs
- WindowInteractionStateTracker.cs
- HMACMD5.cs
- RenderingEventArgs.cs
- VisualBasicImportReference.cs
- BitmapFrameEncode.cs
- SQLBytesStorage.cs
- MetadataItemEmitter.cs
- HtmlInputButton.cs
- TextOutput.cs
- FixedTextSelectionProcessor.cs
- StylusButton.cs
- RightsManagementPermission.cs
- SystemIPv4InterfaceProperties.cs
- StyleTypedPropertyAttribute.cs
- StorageComplexTypeMapping.cs
- RawTextInputReport.cs
- DetailsViewUpdateEventArgs.cs
- PointHitTestResult.cs
- PointLight.cs
- OutKeywords.cs
- RuleSetDialog.cs
- BinaryFormatterWriter.cs
- EntityDataSourceChangedEventArgs.cs
- ServiceOperation.cs
- _BaseOverlappedAsyncResult.cs
- Monitor.cs
- BindToObject.cs
- RayMeshGeometry3DHitTestResult.cs
- SafeThemeHandle.cs
- ClassHandlersStore.cs
- InputBuffer.cs
- XmlNodeComparer.cs
- IDQuery.cs
- IntegerFacetDescriptionElement.cs
- XmlDataSource.cs
- XmlSerializerFactory.cs
- PersonalizationEntry.cs
- SiteMapDataSourceView.cs
- TextParagraphView.cs
- DataFormats.cs
- DistributedTransactionPermission.cs
- __Error.cs
- WindowManager.cs
- SchemaExporter.cs
- DataGridRow.cs
- TreeViewEvent.cs
- LinkedResourceCollection.cs
- DataViewSetting.cs
- dbdatarecord.cs
- CapabilitiesState.cs
- JoinSymbol.cs
- Util.cs
- TextProperties.cs
- DoubleCollectionConverter.cs
- Soap.cs
- SqlDataSourceView.cs
- UnsafeNativeMethods.cs
- InkSerializer.cs
- StyleSelector.cs
- DBNull.cs
- HtmlTableRow.cs
- HierarchicalDataBoundControl.cs
- MessageSmuggler.cs
- ImageButton.cs
- ClientRuntimeConfig.cs