Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- PropertyChangedEventManager.cs
- SettingsAttributes.cs
- SignedXml.cs
- MetabaseSettings.cs
- WindowsGraphicsCacheManager.cs
- ToolStripItemRenderEventArgs.cs
- MenuItemBinding.cs
- GifBitmapEncoder.cs
- UIElementCollection.cs
- ProxyHelper.cs
- Type.cs
- MenuItemCollectionEditorDialog.cs
- DigitShape.cs
- FixedFindEngine.cs
- CodeGeneratorOptions.cs
- DoWorkEventArgs.cs
- WebPartDisplayMode.cs
- SoapCommonClasses.cs
- HelloOperationCD1AsyncResult.cs
- BackgroundFormatInfo.cs
- ValidationErrorCollection.cs
- XmlConvert.cs
- DynamicMethod.cs
- XmlNodeComparer.cs
- Stylesheet.cs
- SoapWriter.cs
- MenuItemStyleCollection.cs
- ParameterBinding.cs
- SecureEnvironment.cs
- CharStorage.cs
- SequentialUshortCollection.cs
- TextLineResult.cs
- ArithmeticException.cs
- ProvidersHelper.cs
- Win32KeyboardDevice.cs
- MultipleViewProviderWrapper.cs
- RoutedEventValueSerializer.cs
- SchemaElementLookUpTableEnumerator.cs
- FormsAuthenticationConfiguration.cs
- RichTextBox.cs
- ResXFileRef.cs
- ProcessHostServerConfig.cs
- ServicePoint.cs
- LambdaCompiler.Expressions.cs
- Html32TextWriter.cs
- CommandID.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- DecoratedNameAttribute.cs
- PeerContact.cs
- PageOutputColor.cs
- ComplusTypeValidator.cs
- NumericPagerField.cs
- DeclarativeExpressionConditionDeclaration.cs
- RecognizerInfo.cs
- Confirm.cs
- PathParser.cs
- LicenseException.cs
- TimeoutHelper.cs
- NameValueCollection.cs
- Random.cs
- TimeoutException.cs
- TableLayoutPanelBehavior.cs
- MsmqMessageProperty.cs
- LocalFileSettingsProvider.cs
- DefaultPropertyAttribute.cs
- LabelAutomationPeer.cs
- Inline.cs
- ContentElement.cs
- OperationGenerator.cs
- ConsoleCancelEventArgs.cs
- RouteParser.cs
- RepeatInfo.cs
- SqlBulkCopyColumnMappingCollection.cs
- ThreadBehavior.cs
- RegexRunner.cs
- DataViewManager.cs
- UserControl.cs
- Command.cs
- RtfFormatStack.cs
- TransactionManager.cs
- Terminate.cs
- InputProviderSite.cs
- Int32CollectionConverter.cs
- MsmqIntegrationValidationBehavior.cs
- ReadOnlyPropertyMetadata.cs
- URIFormatException.cs
- DocumentScope.cs
- GenerateHelper.cs
- Mappings.cs
- DbProviderServices.cs
- HMACMD5.cs
- ContentPropertyAttribute.cs
- ResourceManager.cs
- ScriptingScriptResourceHandlerSection.cs
- ObjectDataSourceMethodEventArgs.cs
- SqlTypeConverter.cs
- IntSecurity.cs
- FullTrustAssemblyCollection.cs
- ValuePatternIdentifiers.cs
- RelationshipEndCollection.cs