Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TemplateColumn.cs
- ApplicationContext.cs
- OutputCacheSettingsSection.cs
- AttributeUsageAttribute.cs
- DeflateEmulationStream.cs
- SqlWebEventProvider.cs
- ReflectionHelper.cs
- XPathNavigatorKeyComparer.cs
- ZipIOLocalFileDataDescriptor.cs
- Fx.cs
- StartUpEventArgs.cs
- PermissionRequestEvidence.cs
- AlphaSortedEnumConverter.cs
- Point.cs
- _SingleItemRequestCache.cs
- MailAddress.cs
- EntityConnectionStringBuilderItem.cs
- TextContainerHelper.cs
- ConnectorDragDropGlyph.cs
- SQLChars.cs
- ReferencedAssemblyResolver.cs
- LOSFormatter.cs
- SQLStringStorage.cs
- BufferBuilder.cs
- RegisteredExpandoAttribute.cs
- Utils.cs
- DataGridViewImageColumn.cs
- RegexCaptureCollection.cs
- Point3DCollectionConverter.cs
- ButtonBase.cs
- GridViewColumn.cs
- Size.cs
- Material.cs
- FormatConvertedBitmap.cs
- SqlReferenceCollection.cs
- ConnectorDragDropGlyph.cs
- DataBindingExpressionBuilder.cs
- SiteMapProvider.cs
- MsmqIntegrationBindingElement.cs
- DispatcherProcessingDisabled.cs
- LockCookie.cs
- SourceElementsCollection.cs
- QueryRewriter.cs
- OutputCacheSettingsSection.cs
- PreProcessor.cs
- ObjectToIdCache.cs
- IsolatedStorageFilePermission.cs
- WorkflowShape.cs
- CharacterMetricsDictionary.cs
- DBConnectionString.cs
- BaseInfoTable.cs
- WindowsMenu.cs
- FullTextLine.cs
- WebConfigurationHostFileChange.cs
- DesignerGenericWebPart.cs
- BeginGetFileNameFromUserRequest.cs
- PointAnimation.cs
- __Filters.cs
- ChoiceConverter.cs
- DataContract.cs
- UnaryNode.cs
- ErrorWebPart.cs
- SystemInformation.cs
- SchemaCollectionPreprocessor.cs
- SettingsAttributeDictionary.cs
- SessionState.cs
- QueryStringParameter.cs
- XmlDesignerDataSourceView.cs
- KnownBoxes.cs
- PolyLineSegmentFigureLogic.cs
- TextCompositionEventArgs.cs
- UnsafeNativeMethods.cs
- PersonalizationStateInfo.cs
- KeyInstance.cs
- TransactionChannelListener.cs
- Substitution.cs
- ContextBase.cs
- DefaultTraceListener.cs
- RtfControlWordInfo.cs
- DesignBindingPicker.cs
- GlobalAclOperationRequirement.cs
- WithStatement.cs
- SoapServerMessage.cs
- LicenseContext.cs
- ImportContext.cs
- SqlCacheDependencyDatabaseCollection.cs
- webeventbuffer.cs
- RtfToXamlReader.cs
- ManifestResourceInfo.cs
- SmiMetaData.cs
- CodeConditionStatement.cs
- DiscoveryClientChannelBase.cs
- ArraySubsetEnumerator.cs
- UtilityExtension.cs
- CacheDict.cs
- TextureBrush.cs
- PartialCachingControl.cs
- IInstanceContextProvider.cs
- RequestQueue.cs
- ColorBlend.cs