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
- EventDescriptor.cs
- SetterBase.cs
- XmlSchemaGroupRef.cs
- CopyAction.cs
- StreamAsIStream.cs
- IdentitySection.cs
- PickBranchDesigner.xaml.cs
- DocumentPropertiesDialog.cs
- XmlDesignerDataSourceView.cs
- TypeContext.cs
- ContextInformation.cs
- XmlSchemaComplexContent.cs
- ToolStripRenderer.cs
- ExpressionCopier.cs
- TypeSystem.cs
- PresentationAppDomainManager.cs
- SymLanguageType.cs
- InputScope.cs
- GlyphRunDrawing.cs
- DataServiceRequest.cs
- ConfigXmlText.cs
- DefaultProxySection.cs
- ContentElement.cs
- ForEachDesigner.xaml.cs
- PathParser.cs
- EmissiveMaterial.cs
- MultipartContentParser.cs
- ColorAnimationBase.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- CodeCastExpression.cs
- TagNameToTypeMapper.cs
- SmtpTransport.cs
- SystemIPv6InterfaceProperties.cs
- TranslateTransform.cs
- CharAnimationBase.cs
- XpsFontSubsetter.cs
- PriorityQueue.cs
- RootProfilePropertySettingsCollection.cs
- ConfigurationLocationCollection.cs
- EntityContainerAssociationSet.cs
- ToolStripDropDownMenu.cs
- safesecurityhelperavalon.cs
- BigIntegerStorage.cs
- TreeView.cs
- MILUtilities.cs
- EntityModelSchemaGenerator.cs
- ToolStripMenuItem.cs
- NetCodeGroup.cs
- KeyToListMap.cs
- DataServiceQueryProvider.cs
- HostUtils.cs
- HttpRequestContext.cs
- FormsAuthenticationModule.cs
- MemoryResponseElement.cs
- GenerateTemporaryTargetAssembly.cs
- Quaternion.cs
- TimeoutHelper.cs
- BidirectionalDictionary.cs
- EmptyQuery.cs
- WebConfigurationHost.cs
- AutomationAttributeInfo.cs
- IISUnsafeMethods.cs
- PropertyPathWorker.cs
- GeometryCollection.cs
- WaitForChangedResult.cs
- DeadCharTextComposition.cs
- VideoDrawing.cs
- DataViewManagerListItemTypeDescriptor.cs
- ListBindingHelper.cs
- ListViewHitTestInfo.cs
- DropShadowEffect.cs
- CodeArrayCreateExpression.cs
- ViewGenerator.cs
- WsatTransactionFormatter.cs
- DBNull.cs
- MethodImplAttribute.cs
- FacetDescriptionElement.cs
- ImageKeyConverter.cs
- TypeExtension.cs
- DataSourceIDConverter.cs
- GradientBrush.cs
- SAPICategories.cs
- DoubleAverageAggregationOperator.cs
- AndCondition.cs
- SerializationObjectManager.cs
- MenuItemStyleCollection.cs
- XmlSerializerSection.cs
- DataServiceQueryException.cs
- addressfiltermode.cs
- webproxy.cs
- PagesChangedEventArgs.cs
- ClientType.cs
- ProgressBarAutomationPeer.cs
- DataBindingExpressionBuilder.cs
- Line.cs
- SqlUDTStorage.cs
- EnumConverter.cs
- StoryFragments.cs
- SqlCacheDependencyDatabase.cs
- SoapAttributeOverrides.cs