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
- PopupRoot.cs
- MexTcpBindingCollectionElement.cs
- DecoderBestFitFallback.cs
- InputProcessorProfilesLoader.cs
- XmlSchemaSubstitutionGroup.cs
- ToolboxItemAttribute.cs
- BinarySecretKeyIdentifierClause.cs
- UnionCodeGroup.cs
- DataGridViewButtonColumn.cs
- AttributeExtensions.cs
- PaperSize.cs
- localization.cs
- LassoHelper.cs
- PeerResolverMode.cs
- IODescriptionAttribute.cs
- Rules.cs
- SmtpLoginAuthenticationModule.cs
- CharacterBufferReference.cs
- COM2PropertyPageUITypeConverter.cs
- RowUpdatingEventArgs.cs
- BehaviorDragDropEventArgs.cs
- PointIndependentAnimationStorage.cs
- EnumMember.cs
- Argument.cs
- Window.cs
- ValueTypePropertyReference.cs
- PermissionSet.cs
- TrustLevel.cs
- WebControlParameterProxy.cs
- DeviceFiltersSection.cs
- odbcmetadatafactory.cs
- ComponentCollection.cs
- ISessionStateStore.cs
- ToolStripDesignerAvailabilityAttribute.cs
- WorkItem.cs
- ServiceEndpointElement.cs
- ProfessionalColorTable.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- ServicePointManager.cs
- GradientSpreadMethodValidation.cs
- FrameDimension.cs
- TTSEngineProxy.cs
- _DigestClient.cs
- SBCSCodePageEncoding.cs
- StylusPointPropertyInfoDefaults.cs
- CdpEqualityComparer.cs
- DateTimeFormat.cs
- Label.cs
- TextContainerChangedEventArgs.cs
- InputBinding.cs
- DataGridCellAutomationPeer.cs
- StatusBarPanel.cs
- TextContainer.cs
- SoundPlayer.cs
- assertwrapper.cs
- TextFindEngine.cs
- SiteMapProvider.cs
- UnsafeNativeMethods.cs
- DocumentPageHost.cs
- ImmutableObjectAttribute.cs
- EntitySqlQueryBuilder.cs
- AnnouncementEndpoint.cs
- EdmPropertyAttribute.cs
- ClaimTypeElementCollection.cs
- Partitioner.cs
- ValidatedControlConverter.cs
- RemoteWebConfigurationHost.cs
- DispatchWrapper.cs
- ScrollChrome.cs
- ExpressionNode.cs
- RegionData.cs
- ArrayListCollectionBase.cs
- HMACRIPEMD160.cs
- AddingNewEventArgs.cs
- ActionMismatchAddressingException.cs
- WebPartTransformer.cs
- Rectangle.cs
- RegexStringValidatorAttribute.cs
- RtfControlWordInfo.cs
- LogicalTreeHelper.cs
- HtmlGenericControl.cs
- ProcessInfo.cs
- XPathParser.cs
- PartDesigner.cs
- XmlAtomErrorReader.cs
- OleDbSchemaGuid.cs
- SmiTypedGetterSetter.cs
- PersistenceTypeAttribute.cs
- HandleCollector.cs
- MenuAdapter.cs
- AssemblyCache.cs
- X509SecurityTokenProvider.cs
- EntityClientCacheKey.cs
- DesignerSerializationOptionsAttribute.cs
- AssemblyBuilder.cs
- TextDpi.cs
- HtmlFormParameterWriter.cs
- OdbcException.cs
- BaseHashHelper.cs
- Drawing.cs