Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbConnectionInternal.cs
- BinHexDecoder.cs
- DataControlLinkButton.cs
- PostBackTrigger.cs
- MethodImplAttribute.cs
- CompilerGeneratedAttribute.cs
- XmlObjectSerializerWriteContext.cs
- UInt32.cs
- ComplexTypeEmitter.cs
- MemoryFailPoint.cs
- ReachNamespaceInfo.cs
- DecodeHelper.cs
- SecurityTokenResolver.cs
- ConstraintEnumerator.cs
- GatewayIPAddressInformationCollection.cs
- RC2CryptoServiceProvider.cs
- thaishape.cs
- GeneralTransform2DTo3D.cs
- GeneralTransform3DCollection.cs
- Root.cs
- SmiGettersStream.cs
- Char.cs
- SchemaTableOptionalColumn.cs
- ApplicationContext.cs
- Route.cs
- SpotLight.cs
- SizeF.cs
- DataGridViewSelectedRowCollection.cs
- ConfigXmlElement.cs
- UnmanagedMemoryStreamWrapper.cs
- Matrix3DConverter.cs
- Debugger.cs
- DesignTimeVisibleAttribute.cs
- CodeCompileUnit.cs
- QueryContinueDragEvent.cs
- CursorInteropHelper.cs
- RoleBoolean.cs
- RoutedEvent.cs
- GlobalEventManager.cs
- DigitShape.cs
- IRCollection.cs
- TdsParserSafeHandles.cs
- NestedContainer.cs
- _LocalDataStore.cs
- Vars.cs
- RoleProviderPrincipal.cs
- SequentialWorkflowHeaderFooter.cs
- ViewGenResults.cs
- InputMethod.cs
- Completion.cs
- DefaultValueAttribute.cs
- ServiceDurableInstanceContextProvider.cs
- Point3D.cs
- DirectoryObjectSecurity.cs
- ListenerElementsCollection.cs
- BufferedStream.cs
- BrowserTree.cs
- TransformerConfigurationWizardBase.cs
- WindowAutomationPeer.cs
- Simplifier.cs
- ObjectDataSourceDisposingEventArgs.cs
- PermissionSet.cs
- _DigestClient.cs
- ScrollProviderWrapper.cs
- InputScopeNameConverter.cs
- IgnoreFileBuildProvider.cs
- DataDocumentXPathNavigator.cs
- ParserOptions.cs
- SubstitutionList.cs
- TextTreeFixupNode.cs
- DataGridRelationshipRow.cs
- RoleManagerSection.cs
- AppDomainInfo.cs
- XmlDataImplementation.cs
- ServicePoint.cs
- ScrollBar.cs
- Base64Decoder.cs
- MultiBinding.cs
- MethodToken.cs
- OleStrCAMarshaler.cs
- XLinq.cs
- ToolStripSplitButton.cs
- HttpModuleCollection.cs
- DockPanel.cs
- BitmapEffect.cs
- WindowsSlider.cs
- FileDialogPermission.cs
- FontSizeConverter.cs
- UTF32Encoding.cs
- OperationAbortedException.cs
- ClientCultureInfo.cs
- __Filters.cs
- NavigateEvent.cs
- WebConfigManager.cs
- MulticastDelegate.cs
- XPathNavigator.cs
- SqlDataSourceRefreshSchemaForm.cs
- CompiledRegexRunner.cs
- ConfigurationLockCollection.cs
- XsdDateTime.cs