Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LinkedResourceCollection.cs
- XPathAxisIterator.cs
- InstanceKeyView.cs
- TrailingSpaceComparer.cs
- Ops.cs
- BindToObject.cs
- OpenTypeLayoutCache.cs
- MasterPageParser.cs
- AppDomainFactory.cs
- BaseTemplateBuildProvider.cs
- ImagingCache.cs
- ConfigurationManagerHelper.cs
- Splitter.cs
- SelfIssuedSamlTokenFactory.cs
- AtomMaterializerLog.cs
- Int16Converter.cs
- SubstitutionResponseElement.cs
- IxmlLineInfo.cs
- ClusterRegistryConfigurationProvider.cs
- ServerValidateEventArgs.cs
- MaterialGroup.cs
- DesignerDataConnection.cs
- cookieexception.cs
- ReadOnlyDataSourceView.cs
- ComboBox.cs
- CompositionCommandSet.cs
- TrustManagerMoreInformation.cs
- Roles.cs
- UserInitiatedNavigationPermission.cs
- ParseChildrenAsPropertiesAttribute.cs
- ServerValidateEventArgs.cs
- HybridObjectCache.cs
- SQLString.cs
- XPathChildIterator.cs
- PolicyManager.cs
- LoadedOrUnloadedOperation.cs
- ChtmlFormAdapter.cs
- StructuredTypeInfo.cs
- IpcClientManager.cs
- _ContextAwareResult.cs
- ToolStripArrowRenderEventArgs.cs
- DocumentViewerBaseAutomationPeer.cs
- ErrorStyle.cs
- AuthenticationManager.cs
- DescendantQuery.cs
- HttpPostedFile.cs
- ListViewSelectEventArgs.cs
- Speller.cs
- DbSourceCommand.cs
- HttpCookie.cs
- ToolStripButton.cs
- EntityClassGenerator.cs
- SimpleRecyclingCache.cs
- SaveFileDialog.cs
- Comparer.cs
- ParamArrayAttribute.cs
- ReliableMessagingVersionConverter.cs
- WaitHandleCannotBeOpenedException.cs
- XPathMultyIterator.cs
- TextEditorSpelling.cs
- Privilege.cs
- InkCollectionBehavior.cs
- CheckBoxFlatAdapter.cs
- OdbcConnectionFactory.cs
- ApplicationManager.cs
- ExpressionBinding.cs
- DataSourceExpression.cs
- SponsorHelper.cs
- ObjectDataSourceStatusEventArgs.cs
- ComplexPropertyEntry.cs
- ButtonBaseAdapter.cs
- StorageEntityTypeMapping.cs
- VirtualDirectoryMappingCollection.cs
- WebResponse.cs
- MultiTargetingUtil.cs
- StoreItemCollection.Loader.cs
- Wow64ConfigurationLoader.cs
- EncoderReplacementFallback.cs
- ServiceReference.cs
- PrinterUnitConvert.cs
- mediapermission.cs
- MediaContext.cs
- DataControlFieldCollection.cs
- GenericArgumentsUpdater.cs
- BaseComponentEditor.cs
- TextViewBase.cs
- ModelChangedEventArgsImpl.cs
- XDRSchema.cs
- WindowsPrincipal.cs
- EditingCoordinator.cs
- ErrorLog.cs
- WeakEventTable.cs
- TextSelection.cs
- CodeRegionDirective.cs
- SettingsBase.cs
- IsolationInterop.cs
- ImmutableObjectAttribute.cs
- DownloadProgressEventArgs.cs
- BaseCollection.cs
- Pkcs7Recipient.cs