Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TextDocumentView.cs
- SiteMapSection.cs
- BadImageFormatException.cs
- FrameworkElementAutomationPeer.cs
- XPathMultyIterator.cs
- SQLBytes.cs
- HashSet.cs
- FrameworkTemplate.cs
- CompleteWizardStep.cs
- _NegoStream.cs
- DbMetaDataColumnNames.cs
- Int16AnimationBase.cs
- CodeSnippetExpression.cs
- AVElementHelper.cs
- IOThreadTimer.cs
- ClientSettingsSection.cs
- DataViewManagerListItemTypeDescriptor.cs
- MarginsConverter.cs
- ScopelessEnumAttribute.cs
- SortAction.cs
- FilterQueryOptionExpression.cs
- ConfigurationManagerInternal.cs
- CustomExpression.cs
- AccessibleObject.cs
- ConfigurationSectionGroup.cs
- ReadOnlyTernaryTree.cs
- SqlCrossApplyToCrossJoin.cs
- HMACMD5.cs
- WebSysDisplayNameAttribute.cs
- EDesignUtil.cs
- LoadItemsEventArgs.cs
- SynchronizedDispatch.cs
- RadialGradientBrush.cs
- dbenumerator.cs
- RadioButtonPopupAdapter.cs
- EditingCommands.cs
- SqlRecordBuffer.cs
- ISO2022Encoding.cs
- SmtpLoginAuthenticationModule.cs
- ContentPosition.cs
- AutoResetEvent.cs
- FunctionParameter.cs
- DirectoryInfo.cs
- TextEditorThreadLocalStore.cs
- SqlCacheDependencySection.cs
- XmlSchemaObjectTable.cs
- Rectangle.cs
- GridViewDeletedEventArgs.cs
- UInt32.cs
- PageParser.cs
- Win32SafeHandles.cs
- PrivilegeNotHeldException.cs
- CollectionTypeElement.cs
- CompiledQuery.cs
- IntSecurity.cs
- SizeAnimationClockResource.cs
- FunctionMappingTranslator.cs
- ControlLocalizer.cs
- CounterSample.cs
- cookiecontainer.cs
- DataGridViewToolTip.cs
- XPathEmptyIterator.cs
- IOThreadTimer.cs
- EventData.cs
- SecurityKeyIdentifier.cs
- ObjectListSelectEventArgs.cs
- AssemblyAttributesGoHere.cs
- EnumUnknown.cs
- AmbiguousMatchException.cs
- MultiBindingExpression.cs
- MemberInfoSerializationHolder.cs
- CornerRadius.cs
- FunctionImportMapping.cs
- TextStore.cs
- Shape.cs
- BindStream.cs
- ASCIIEncoding.cs
- RevocationPoint.cs
- ProgressBar.cs
- SystemInformation.cs
- SafeReadContext.cs
- GlyphRun.cs
- RequestCachePolicyConverter.cs
- CachedCompositeFamily.cs
- ChangePasswordDesigner.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- TextElementEnumerator.cs
- InternalBase.cs
- BaseTemplateParser.cs
- ClientRoleProvider.cs
- XmlObjectSerializerContext.cs
- HtmlEmptyTagControlBuilder.cs
- DataGridViewRowCollection.cs
- Operators.cs
- StrokeNode.cs
- BuilderPropertyEntry.cs
- ExpressionReplacer.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- Popup.cs
- GZipDecoder.cs