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
- _ConnectionGroup.cs
- MediaCommands.cs
- TreeNodeCollectionEditor.cs
- DiscriminatorMap.cs
- CacheEntry.cs
- HitTestFilterBehavior.cs
- GenericAuthenticationEventArgs.cs
- Win32.cs
- IteratorDescriptor.cs
- ScrollBar.cs
- XmlIncludeAttribute.cs
- SqlDataSourceSelectingEventArgs.cs
- HtmlTextViewAdapter.cs
- SqlConnectionFactory.cs
- Array.cs
- CustomAttributeBuilder.cs
- PropertyFilterAttribute.cs
- RuntimeHelpers.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- CodeSnippetTypeMember.cs
- UnsupportedPolicyOptionsException.cs
- Keywords.cs
- HashMembershipCondition.cs
- TreeViewImageKeyConverter.cs
- FrameworkContentElement.cs
- Statements.cs
- ProfileService.cs
- CompositeKey.cs
- TextPenaltyModule.cs
- PageCatalogPart.cs
- ClientUtils.cs
- DesignerDeviceConfig.cs
- CommandConverter.cs
- BitmapData.cs
- CancellableEnumerable.cs
- UnrecognizedPolicyAssertionElement.cs
- RangeValidator.cs
- MetadataItem_Static.cs
- DependencyStoreSurrogate.cs
- RegexReplacement.cs
- ArrayExtension.cs
- MonthCalendar.cs
- BaseDataListActionList.cs
- StrongName.cs
- ObjectDataSourceView.cs
- XsdBuildProvider.cs
- Exceptions.cs
- TimeSpanMinutesConverter.cs
- BooleanSwitch.cs
- EntityViewGenerator.cs
- ColumnHeaderConverter.cs
- ObjectQuery.cs
- SHA256Managed.cs
- WsatServiceAddress.cs
- SqlTypesSchemaImporter.cs
- QilVisitor.cs
- EventDescriptorCollection.cs
- CrossSiteScriptingValidation.cs
- FontWeights.cs
- ScrollChrome.cs
- ValidationService.cs
- Effect.cs
- PolyBezierSegmentFigureLogic.cs
- ValidationEventArgs.cs
- LinqDataSourceContextEventArgs.cs
- SignatureHelper.cs
- CodeAttributeArgument.cs
- InstanceKey.cs
- InProcStateClientManager.cs
- TextDecoration.cs
- LocationSectionRecord.cs
- SelectiveScrollingGrid.cs
- X509ImageLogo.cs
- designeractionlistschangedeventargs.cs
- MiniMapControl.xaml.cs
- ClipboardProcessor.cs
- HwndSubclass.cs
- IgnoreFileBuildProvider.cs
- AuthenticateEventArgs.cs
- SerializationException.cs
- MarkedHighlightComponent.cs
- URLIdentityPermission.cs
- Environment.cs
- StreamSecurityUpgradeInitiatorBase.cs
- ToolboxCategoryItems.cs
- DataGridPageChangedEventArgs.cs
- PackageStore.cs
- SignatureGenerator.cs
- EllipseGeometry.cs
- StylusButtonEventArgs.cs
- SafeProcessHandle.cs
- _ShellExpression.cs
- RequestNavigateEventArgs.cs
- CalculatedColumn.cs
- SymbolDocumentInfo.cs
- ThicknessAnimation.cs
- SmiEventStream.cs
- XmlTextReaderImplHelpers.cs
- ThemeConfigurationDialog.cs
- LoadedOrUnloadedOperation.cs