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
- WebBrowserNavigatedEventHandler.cs
- DataGridViewColumnEventArgs.cs
- RowParagraph.cs
- ChannelDispatcherCollection.cs
- Mouse.cs
- DesignerWebPartChrome.cs
- EncoderFallback.cs
- XmlUnspecifiedAttribute.cs
- IconBitmapDecoder.cs
- SpecularMaterial.cs
- HostProtectionException.cs
- CompilationSection.cs
- pingexception.cs
- WindowsFormsHost.cs
- SoundPlayerAction.cs
- RoleBoolean.cs
- SyndicationFeedFormatter.cs
- Exceptions.cs
- ControlValuePropertyAttribute.cs
- PersonalizationState.cs
- NavigationWindowAutomationPeer.cs
- DetailsViewUpdateEventArgs.cs
- StdValidatorsAndConverters.cs
- DataServiceContext.cs
- EdmTypeAttribute.cs
- DataControlFieldCollection.cs
- DataGridViewSelectedColumnCollection.cs
- WebPartAuthorizationEventArgs.cs
- ParserStreamGeometryContext.cs
- LogExtent.cs
- ValidatorCompatibilityHelper.cs
- ConnectionProviderAttribute.cs
- EntityDataSourceContainerNameItem.cs
- QueryAsyncResult.cs
- RequestCache.cs
- Property.cs
- HWStack.cs
- DesignTimeType.cs
- PerspectiveCamera.cs
- OleDbConnectionInternal.cs
- LineGeometry.cs
- SqlCacheDependencyDatabase.cs
- WinCategoryAttribute.cs
- WebResourceAttribute.cs
- MobileUserControl.cs
- SecurityTokenSerializer.cs
- ModelPropertyDescriptor.cs
- TablePattern.cs
- PersonalizationDictionary.cs
- ObjectViewFactory.cs
- BridgeDataRecord.cs
- XmlDataDocument.cs
- OptimalBreakSession.cs
- StateRuntime.cs
- SingleConverter.cs
- XPathNodeIterator.cs
- RoleGroupCollection.cs
- DropShadowBitmapEffect.cs
- UrlPropertyAttribute.cs
- PKCS1MaskGenerationMethod.cs
- MultipartContentParser.cs
- PeerServiceMessageContracts.cs
- TrustLevel.cs
- Function.cs
- DrawingAttributesDefaultValueFactory.cs
- Icon.cs
- PolicyUnit.cs
- MultipartContentParser.cs
- KeyPressEvent.cs
- HeaderPanel.cs
- TextServicesCompartmentContext.cs
- IgnoreSection.cs
- BeginEvent.cs
- ParallelLoopState.cs
- LingerOption.cs
- XmlSecureResolver.cs
- ColorConvertedBitmap.cs
- AliasedSlot.cs
- ParserStreamGeometryContext.cs
- EndOfStreamException.cs
- DrawTreeNodeEventArgs.cs
- CodeTypeReferenceExpression.cs
- InternalBufferOverflowException.cs
- TracingConnectionInitiator.cs
- FormClosingEvent.cs
- ToolStripDropDownClosingEventArgs.cs
- WebMessageEncoderFactory.cs
- _DisconnectOverlappedAsyncResult.cs
- XsltArgumentList.cs
- ResourceProperty.cs
- SoapIgnoreAttribute.cs
- PersonalizationStateInfo.cs
- COM2PropertyBuilderUITypeEditor.cs
- DocumentPageHost.cs
- DataControlLinkButton.cs
- PropertyKey.cs
- DropShadowBitmapEffect.cs
- WebPartVerbCollection.cs
- VisualBasic.cs
- BinaryKeyIdentifierClause.cs