Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Error.cs
- BinaryFormatter.cs
- followingsibling.cs
- ProgressPage.cs
- FieldInfo.cs
- PerfCounters.cs
- ResXResourceReader.cs
- DotExpr.cs
- DataTemplate.cs
- ResourceIDHelper.cs
- Metadata.cs
- OrderToken.cs
- SimpleHandlerFactory.cs
- XmlSchemaObjectTable.cs
- ConfigurationElementCollection.cs
- ColorContextHelper.cs
- XmlElementList.cs
- EntityTypeEmitter.cs
- DesignSurfaceEvent.cs
- VisualStyleTypesAndProperties.cs
- GridViewUpdateEventArgs.cs
- RTTypeWrapper.cs
- SqlBulkCopyColumnMappingCollection.cs
- CachedBitmap.cs
- HitTestFilterBehavior.cs
- RegexCompilationInfo.cs
- FormConverter.cs
- ProfilePropertyMetadata.cs
- CustomAttribute.cs
- SchemaConstraints.cs
- IsolatedStorageFileStream.cs
- DockAndAnchorLayout.cs
- RootNamespaceAttribute.cs
- MetadataPropertyvalue.cs
- streamingZipPartStream.cs
- AnnotationResourceCollection.cs
- input.cs
- MetadataSerializer.cs
- XmlSchemaAttribute.cs
- CompilationSection.cs
- TypeToArgumentTypeConverter.cs
- StrongName.cs
- PropertyInfoSet.cs
- FullTextState.cs
- Floater.cs
- PopupEventArgs.cs
- Margins.cs
- MetadataFile.cs
- TextElementCollectionHelper.cs
- SymbolEqualComparer.cs
- DefaultBindingPropertyAttribute.cs
- IPGlobalProperties.cs
- MapPathBasedVirtualPathProvider.cs
- LazyInitializer.cs
- EntityContainer.cs
- Vector.cs
- ScriptServiceAttribute.cs
- CodeMethodReturnStatement.cs
- FixedPageStructure.cs
- Item.cs
- TextRenderer.cs
- DesignerObjectListAdapter.cs
- FileCodeGroup.cs
- ImageUrlEditor.cs
- TextRangeEditTables.cs
- ProviderIncompatibleException.cs
- UniqueIdentifierService.cs
- ToolStripSplitButton.cs
- HtmlWindowCollection.cs
- TrimSurroundingWhitespaceAttribute.cs
- SynchronizedInputHelper.cs
- IODescriptionAttribute.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- DPAPIProtectedConfigurationProvider.cs
- BinaryReader.cs
- GeneralTransformGroup.cs
- CompilerWrapper.cs
- DrawListViewColumnHeaderEventArgs.cs
- BrowserCapabilitiesFactoryBase.cs
- DataBoundControlAdapter.cs
- EventMap.cs
- GridItemCollection.cs
- Size.cs
- CachedCompositeFamily.cs
- TogglePatternIdentifiers.cs
- LogLogRecordHeader.cs
- ClientSettingsSection.cs
- ObjectItemCachedAssemblyLoader.cs
- ViewSimplifier.cs
- PkcsUtils.cs
- AuthenticationModuleElement.cs
- ImageAutomationPeer.cs
- Zone.cs
- TriggerBase.cs
- Expressions.cs
- FocusTracker.cs
- CompareInfo.cs
- PenContexts.cs
- XsdCachingReader.cs
- FontSourceCollection.cs