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
- CodeAccessPermission.cs
- Visual3DCollection.cs
- EventDrivenDesigner.cs
- SiteMapNodeItemEventArgs.cs
- ExpressionBuilderContext.cs
- CqlLexer.cs
- ComplexObject.cs
- TypeInitializationException.cs
- ObservableCollection.cs
- WaitForChangedResult.cs
- RefType.cs
- ServerValidateEventArgs.cs
- PropertyGridView.cs
- FileDialog.cs
- ThreadStateException.cs
- HttpListenerResponse.cs
- DataGridViewHeaderCell.cs
- SpinWait.cs
- RecognizerInfo.cs
- DataSourceControlBuilder.cs
- ProcessProtocolHandler.cs
- NamedPipeChannelListener.cs
- BitmapDecoder.cs
- ConstructorBuilder.cs
- GridEntryCollection.cs
- DataGridViewCellValidatingEventArgs.cs
- ForeignConstraint.cs
- TextRangeEdit.cs
- ChannelFactoryRefCache.cs
- HMAC.cs
- TextEditorDragDrop.cs
- GenericParameterDataContract.cs
- TemplatedMailWebEventProvider.cs
- TextClipboardData.cs
- GeometryGroup.cs
- HttpContextBase.cs
- ContextMenuStripActionList.cs
- AppSettingsExpressionBuilder.cs
- CheckBox.cs
- WindowsSpinner.cs
- EntityDataSourceWrapperCollection.cs
- SafeCryptoHandles.cs
- DataSourceGeneratorException.cs
- WinInetCache.cs
- recordstate.cs
- RuntimeIdentifierPropertyAttribute.cs
- StylusPointPropertyInfo.cs
- SrgsText.cs
- WorkflowDesignerMessageFilter.cs
- MsmqInputMessagePool.cs
- HttpModuleAction.cs
- ObjectCache.cs
- ZoneButton.cs
- DefaultParameterValueAttribute.cs
- SqlParameterCollection.cs
- PasswordRecovery.cs
- BinaryReader.cs
- SkewTransform.cs
- CryptoStream.cs
- OrthographicCamera.cs
- SqlRowUpdatingEvent.cs
- ButtonStandardAdapter.cs
- ListViewItem.cs
- EncoderParameter.cs
- BlockUIContainer.cs
- MonthChangedEventArgs.cs
- FileLogRecordHeader.cs
- GeneralTransform3DCollection.cs
- DataRelation.cs
- DocumentSequence.cs
- columnmapfactory.cs
- WebEventCodes.cs
- CounterSample.cs
- lengthconverter.cs
- DocumentSchemaValidator.cs
- EventHandlers.cs
- ContextActivityUtils.cs
- CursorConverter.cs
- PrintPreviewControl.cs
- prompt.cs
- OracleConnectionStringBuilder.cs
- BigInt.cs
- AspNetSynchronizationContext.cs
- PersonalizationStateInfo.cs
- LeaseManager.cs
- ResourcePermissionBase.cs
- DesignerTransaction.cs
- MessageDirection.cs
- EdmSchemaAttribute.cs
- CatalogZoneDesigner.cs
- ListViewDeleteEventArgs.cs
- DataGridToolTip.cs
- XmlFormatWriterGenerator.cs
- NavigationExpr.cs
- IisTraceListener.cs
- InkPresenter.cs
- AnnotationComponentManager.cs
- OciEnlistContext.cs
- SliderAutomationPeer.cs
- CodeTypeReference.cs