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
- CheckBox.cs
- MatchingStyle.cs
- Pair.cs
- CapacityStreamGeometryContext.cs
- lengthconverter.cs
- StandardBindingElement.cs
- ButtonChrome.cs
- ResourcesGenerator.cs
- InputLanguageSource.cs
- File.cs
- ItemChangedEventArgs.cs
- WebEventTraceProvider.cs
- GetWinFXPath.cs
- EncryptedKey.cs
- MsmqProcessProtocolHandler.cs
- HuffmanTree.cs
- Rotation3DAnimation.cs
- IteratorDescriptor.cs
- HttpConfigurationContext.cs
- RTTypeWrapper.cs
- ToolStripDropDownButton.cs
- TrackingDataItemValue.cs
- LoginName.cs
- TextAction.cs
- HtmlContainerControl.cs
- SqlTypeConverter.cs
- SQLGuid.cs
- DrawListViewSubItemEventArgs.cs
- DisplayInformation.cs
- UnionExpr.cs
- WebConfigurationHostFileChange.cs
- UIElement3D.cs
- SchemaCollectionCompiler.cs
- IdleTimeoutMonitor.cs
- ConnectionConsumerAttribute.cs
- Calendar.cs
- SizeConverter.cs
- LabelDesigner.cs
- DescendantQuery.cs
- IndentTextWriter.cs
- SystemKeyConverter.cs
- LayoutEvent.cs
- BatchParser.cs
- CompiledQuery.cs
- WeakRefEnumerator.cs
- WebZone.cs
- TypeConverterAttribute.cs
- MSG.cs
- SafeLibraryHandle.cs
- IndexerHelper.cs
- SingleStorage.cs
- MapPathBasedVirtualPathProvider.cs
- EntityCollectionChangedParams.cs
- ProjectionCamera.cs
- ManagementClass.cs
- Point3DConverter.cs
- WebPartManagerDesigner.cs
- WmlControlAdapter.cs
- MultiPartWriter.cs
- columnmapkeybuilder.cs
- PersonalizationProvider.cs
- FlowLayoutPanel.cs
- ParserExtension.cs
- SkinBuilder.cs
- SqlCrossApplyToCrossJoin.cs
- CompilerResults.cs
- SoapAttributeAttribute.cs
- LineGeometry.cs
- Baml2006ReaderSettings.cs
- IconHelper.cs
- SqlDataSourceCommandEventArgs.cs
- WebPartConnectionsCancelEventArgs.cs
- ImageMap.cs
- ProjectionCamera.cs
- XmlNavigatorFilter.cs
- Freezable.cs
- HtmlInputControl.cs
- Itemizer.cs
- DesignerActionUI.cs
- WebSysDefaultValueAttribute.cs
- DataObjectEventArgs.cs
- XmlAttributeCollection.cs
- Setter.cs
- XmlDataContract.cs
- MenuEventArgs.cs
- Viewport3DVisual.cs
- Triplet.cs
- NonVisualControlAttribute.cs
- FrameworkContentElement.cs
- TypeUtils.cs
- OutputCacheProfileCollection.cs
- ParamArrayAttribute.cs
- PageBorderless.cs
- WebServiceTypeData.cs
- Thickness.cs
- PasswordBox.cs
- metadatamappinghashervisitor.cs
- MetadataItemEmitter.cs
- StringAttributeCollection.cs
- BaseHashHelper.cs