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
- ContainerUIElement3D.cs
- DataGridToolTip.cs
- EntityDataSourceView.cs
- StateChangeEvent.cs
- PerfCounterSection.cs
- CompiledQuery.cs
- QuaternionRotation3D.cs
- ModuleBuilderData.cs
- GridViewDeletedEventArgs.cs
- SharedStatics.cs
- TargetControlTypeCache.cs
- DetailsViewCommandEventArgs.cs
- WebPartHeaderCloseVerb.cs
- Simplifier.cs
- WrapPanel.cs
- MessageLoggingFilterTraceRecord.cs
- InvalidOperationException.cs
- ConnectionStringSettings.cs
- TextRangeEditLists.cs
- TextChangedEventArgs.cs
- TypeSystemProvider.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ClientClassGenerator.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- StatusBarItemAutomationPeer.cs
- DotExpr.cs
- MenuItem.cs
- Grid.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- odbcmetadatacollectionnames.cs
- EllipseGeometry.cs
- MappingSource.cs
- UxThemeWrapper.cs
- Serializer.cs
- IRCollection.cs
- BindingExpression.cs
- AppSettingsSection.cs
- HyperLink.cs
- EventsTab.cs
- ComponentEditorPage.cs
- TargetControlTypeCache.cs
- EncodingDataItem.cs
- ACE.cs
- Literal.cs
- SqlDelegatedTransaction.cs
- CodeNamespaceImportCollection.cs
- CodeBlockBuilder.cs
- SerializationAttributes.cs
- EventItfInfo.cs
- DrawingContextWalker.cs
- NeutralResourcesLanguageAttribute.cs
- LocationSectionRecord.cs
- WindowsProgressbar.cs
- NameValueSectionHandler.cs
- LinqDataSource.cs
- TextContainer.cs
- StringDictionary.cs
- EnterpriseServicesHelper.cs
- ReflectionUtil.cs
- WarningException.cs
- UserUseLicenseDictionaryLoader.cs
- StorageEntityTypeMapping.cs
- mactripleDES.cs
- AnnotationResourceChangedEventArgs.cs
- TdsParserSessionPool.cs
- EntityChangedParams.cs
- CommandEventArgs.cs
- SQLBinaryStorage.cs
- MessagePartSpecification.cs
- DataTrigger.cs
- CodeDefaultValueExpression.cs
- BrowserInteropHelper.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- TabPanel.cs
- SizeChangedInfo.cs
- ByteStream.cs
- DataKey.cs
- ControlAdapter.cs
- EnumMember.cs
- XmlDataFileEditor.cs
- DelegateSerializationHolder.cs
- FormsAuthenticationUserCollection.cs
- MeshGeometry3D.cs
- LinqTreeNodeEvaluator.cs
- TemplateControlCodeDomTreeGenerator.cs
- ClientTarget.cs
- PostBackTrigger.cs
- DynamicILGenerator.cs
- XmlWrappingReader.cs
- WeakRefEnumerator.cs
- SpecialFolderEnumConverter.cs
- ListViewEditEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- AutoScrollExpandMessageFilter.cs
- PropertyReferenceSerializer.cs
- ProfileService.cs
- PackWebResponse.cs
- SHA512Managed.cs
- ImportCatalogPart.cs
- TextBoxAutoCompleteSourceConverter.cs