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
- ClipboardProcessor.cs
- NoClickablePointException.cs
- RotateTransform3D.cs
- PolicyManager.cs
- ConfigurationSectionCollection.cs
- Triplet.cs
- UnsettableComboBox.cs
- SystemColorTracker.cs
- UnknownWrapper.cs
- KeyedCollection.cs
- StreamInfo.cs
- GenericNameHandler.cs
- ConvertTextFrag.cs
- GridViewColumnCollection.cs
- GrammarBuilderPhrase.cs
- TextServicesLoader.cs
- OAVariantLib.cs
- TreeViewItem.cs
- TextTreeRootTextBlock.cs
- Component.cs
- AssemblyBuilderData.cs
- ZipIOExtraField.cs
- Delay.cs
- WindowsGraphicsWrapper.cs
- StylusPointCollection.cs
- GridViewUpdatedEventArgs.cs
- ConfigPathUtility.cs
- XmlMapping.cs
- SupportingTokenSpecification.cs
- SQLSingleStorage.cs
- DiscardableAttribute.cs
- Constraint.cs
- ContextStaticAttribute.cs
- SupportsEventValidationAttribute.cs
- RegexMatch.cs
- BaseCollection.cs
- CompositeFontFamily.cs
- ProviderBase.cs
- TransactedReceiveData.cs
- SizeConverter.cs
- ObjectViewQueryResultData.cs
- LinkClickEvent.cs
- PolicyUnit.cs
- SiteMapPath.cs
- DateRangeEvent.cs
- CheckBoxField.cs
- cookie.cs
- NamespaceList.cs
- ObjectRef.cs
- ViewValidator.cs
- ByteConverter.cs
- EndpointDiscoveryMetadata11.cs
- TCPListener.cs
- ReliableMessagingHelpers.cs
- CacheEntry.cs
- DataRelationCollection.cs
- DesignTableCollection.cs
- Point3D.cs
- UrlMappingCollection.cs
- SqlMetaData.cs
- BrushValueSerializer.cs
- DocumentOrderQuery.cs
- CalculatedColumn.cs
- Main.cs
- PopupRootAutomationPeer.cs
- WebPartAuthorizationEventArgs.cs
- ToolBarButton.cs
- EntityDataSourceView.cs
- PeerCollaborationPermission.cs
- ColorIndependentAnimationStorage.cs
- PreviewKeyDownEventArgs.cs
- OleDbCommand.cs
- PriorityItem.cs
- QilLiteral.cs
- CompositeControl.cs
- State.cs
- PolicyStatement.cs
- GeneratedContractType.cs
- DataExpression.cs
- TypeGeneratedEventArgs.cs
- Metadata.cs
- UiaCoreApi.cs
- filewebresponse.cs
- Debugger.cs
- TableRowCollection.cs
- ManipulationCompletedEventArgs.cs
- TypeDelegator.cs
- WindowsSecurityTokenAuthenticator.cs
- IsolatedStorageException.cs
- Renderer.cs
- ContentElement.cs
- BasePropertyDescriptor.cs
- GenericPrincipal.cs
- DataObjectAttribute.cs
- ArraySortHelper.cs
- ContainerFilterService.cs
- PointLightBase.cs
- BmpBitmapEncoder.cs
- ContentTextAutomationPeer.cs
- IsolatedStorageFilePermission.cs