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
- ChannelPool.cs
- FileUpload.cs
- TemplateApplicationHelper.cs
- TextProperties.cs
- SqlInternalConnection.cs
- XmlSchemaSet.cs
- GradientBrush.cs
- Splitter.cs
- TimeoutValidationAttribute.cs
- TextRunCache.cs
- OleDbConnection.cs
- HttpHandlersInstallComponent.cs
- BrowserCapabilitiesFactory.cs
- ReadWriteSpinLock.cs
- ItemsControl.cs
- Int32CAMarshaler.cs
- QuaternionRotation3D.cs
- SelectionGlyphBase.cs
- Exceptions.cs
- filewebrequest.cs
- SettingsContext.cs
- Resources.Designer.cs
- SapiAttributeParser.cs
- SelectionRange.cs
- SerializationAttributes.cs
- Random.cs
- BitVec.cs
- Utils.cs
- DataSourceProvider.cs
- DataTemplateSelector.cs
- ValueSerializer.cs
- Transform.cs
- TypeContext.cs
- ZoomPercentageConverter.cs
- RemotingAttributes.cs
- SqlParameter.cs
- DSACryptoServiceProvider.cs
- OutputCacheSettings.cs
- ResXDataNode.cs
- ProcessHostConfigUtils.cs
- MediaSystem.cs
- GradientStop.cs
- querybuilder.cs
- StrokeFIndices.cs
- MasterPageBuildProvider.cs
- ClipboardData.cs
- TableColumn.cs
- Brush.cs
- BitSet.cs
- XmlDataSourceDesigner.cs
- TileBrush.cs
- QualifiedCellIdBoolean.cs
- Base64Decoder.cs
- SamlAudienceRestrictionCondition.cs
- SmiEventSink_Default.cs
- Timer.cs
- UnsafeNativeMethods.cs
- RtfFormatStack.cs
- IPPacketInformation.cs
- MenuTracker.cs
- KeyValueSerializer.cs
- ConfigurationStrings.cs
- TypeGeneratedEventArgs.cs
- DeclaredTypeElement.cs
- ApplicationException.cs
- DefaultMemberAttribute.cs
- Geometry3D.cs
- ListViewInsertedEventArgs.cs
- ScriptControlDescriptor.cs
- BookmarkWorkItem.cs
- ReaderOutput.cs
- DateTimeConstantAttribute.cs
- DiagnosticsConfigurationHandler.cs
- DATA_BLOB.cs
- Comparer.cs
- NullRuntimeConfig.cs
- Comparer.cs
- DataStorage.cs
- EditorPartCollection.cs
- RbTree.cs
- OdbcError.cs
- HttpCapabilitiesSectionHandler.cs
- SimpleBitVector32.cs
- SqlSupersetValidator.cs
- XmlCharCheckingReader.cs
- AddInEnvironment.cs
- SafeThemeHandle.cs
- PagedDataSource.cs
- HtmlValidatorAdapter.cs
- ListViewSortEventArgs.cs
- CloseSequence.cs
- WaitHandleCannotBeOpenedException.cs
- MsmqPoisonMessageException.cs
- DataServiceProviderWrapper.cs
- XsltInput.cs
- LoadGrammarCompletedEventArgs.cs
- RuleRefElement.cs
- CallContext.cs
- ConfigPathUtility.cs
- CornerRadiusConverter.cs