Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DelegatedStream.cs
- ListViewItem.cs
- SafeRegistryKey.cs
- AssociatedControlConverter.cs
- DataViewManager.cs
- CodeDefaultValueExpression.cs
- AspCompat.cs
- IProducerConsumerCollection.cs
- WebResourceAttribute.cs
- SatelliteContractVersionAttribute.cs
- CharStorage.cs
- VBCodeProvider.cs
- ConfigurationSettings.cs
- VirtualizedCellInfoCollection.cs
- altserialization.cs
- AssignDesigner.xaml.cs
- UnmanagedMarshal.cs
- SystemEvents.cs
- HighlightVisual.cs
- MessageQueuePermissionEntryCollection.cs
- mongolianshape.cs
- ZoneButton.cs
- RuntimeConfigLKG.cs
- MSHTMLHost.cs
- TextRunTypographyProperties.cs
- ClientSponsor.cs
- AesCryptoServiceProvider.cs
- BevelBitmapEffect.cs
- HttpWriter.cs
- DataControlLinkButton.cs
- Binding.cs
- JobDuplex.cs
- DataGridViewBindingCompleteEventArgs.cs
- NativeCppClassAttribute.cs
- Permission.cs
- DataObjectFieldAttribute.cs
- GuidelineSet.cs
- SingleAnimationBase.cs
- StateMachine.cs
- MissingMethodException.cs
- TimeSpan.cs
- PropertyGeneratedEventArgs.cs
- ReliabilityContractAttribute.cs
- DataListItemEventArgs.cs
- StreamReader.cs
- X509Utils.cs
- RestHandler.cs
- EventMappingSettingsCollection.cs
- Section.cs
- MaskedTextBoxTextEditor.cs
- UniqueEventHelper.cs
- XmlQueryCardinality.cs
- StringAttributeCollection.cs
- StringUtil.cs
- DynamicPropertyReader.cs
- ObjectDataSourceSelectingEventArgs.cs
- XmlCDATASection.cs
- ClientTargetSection.cs
- FixedFlowMap.cs
- XslNumber.cs
- ReadOnlyCollection.cs
- ColumnClickEvent.cs
- ManualResetEvent.cs
- Button.cs
- InvokeGenerator.cs
- LoadRetryStrategyFactory.cs
- DataGridViewCellConverter.cs
- VideoDrawing.cs
- SafeEventLogWriteHandle.cs
- invalidudtexception.cs
- PrintPreviewControl.cs
- ItemsPanelTemplate.cs
- SmtpNtlmAuthenticationModule.cs
- XmlUnspecifiedAttribute.cs
- SequentialWorkflowRootDesigner.cs
- DbDataRecord.cs
- DefaultPropertyAttribute.cs
- CharacterHit.cs
- MsmqPoisonMessageException.cs
- CodeDomSerializationProvider.cs
- StrokeDescriptor.cs
- SamlAttributeStatement.cs
- RtfNavigator.cs
- UnsafeNativeMethods.cs
- DbBuffer.cs
- DataBoundControlDesigner.cs
- AuthenticationModuleElement.cs
- FrugalList.cs
- ZoneButton.cs
- Matrix3D.cs
- RuntimeHelpers.cs
- FilteredReadOnlyMetadataCollection.cs
- QilTargetType.cs
- PEFileReader.cs
- ColorTranslator.cs
- OptimisticConcurrencyException.cs
- TraceContext.cs
- FileFormatException.cs
- WasHostedComPlusFactory.cs
- GeneralTransform2DTo3D.cs