Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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(); } } } // 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
- prompt.cs
- AxImporter.cs
- XmlValidatingReader.cs
- SiteMembershipCondition.cs
- SystemDiagnosticsSection.cs
- SizeConverter.cs
- TransportOutputChannel.cs
- ISessionStateStore.cs
- InputQueueChannel.cs
- SystemDropShadowChrome.cs
- ProfilePropertySettingsCollection.cs
- TextAnchor.cs
- PrintingPermission.cs
- listitem.cs
- InternalResources.cs
- Comparer.cs
- TaskHelper.cs
- CollectionBuilder.cs
- FigureHelper.cs
- _ConnectionGroup.cs
- ScriptingWebServicesSectionGroup.cs
- XmlSchemaObject.cs
- EncoderParameter.cs
- ExpressionNormalizer.cs
- ObjectStorage.cs
- WarningException.cs
- wgx_commands.cs
- SurrogateSelector.cs
- XmlAttribute.cs
- ToolBar.cs
- GeometryModel3D.cs
- DeliveryRequirementsAttribute.cs
- XhtmlCssHandler.cs
- OutOfProcStateClientManager.cs
- SelectionProviderWrapper.cs
- ApplicationServicesHostFactory.cs
- CardSpaceException.cs
- BufferedGraphicsContext.cs
- XslAst.cs
- ExtendedPropertyDescriptor.cs
- XPathNode.cs
- OutgoingWebRequestContext.cs
- EditingMode.cs
- GcHandle.cs
- PropertyGridEditorPart.cs
- XmlText.cs
- CommandBindingCollection.cs
- DebugController.cs
- RemoveStoryboard.cs
- DynamicValueConverter.cs
- NativeMethods.cs
- Typeface.cs
- ExpressionBuilder.cs
- ExcCanonicalXml.cs
- ViewStateModeByIdAttribute.cs
- FontSourceCollection.cs
- RegexRunnerFactory.cs
- PrintingPermissionAttribute.cs
- StyleSheetDesigner.cs
- KeyProperty.cs
- VerticalAlignConverter.cs
- DesigntimeLicenseContextSerializer.cs
- EncryptedPackage.cs
- ExtractedStateEntry.cs
- TypeConverterMarkupExtension.cs
- MainMenu.cs
- NumericUpDown.cs
- ReachVisualSerializer.cs
- StringSorter.cs
- HttpModule.cs
- WebRequestModulesSection.cs
- ConnectionConsumerAttribute.cs
- ConcatQueryOperator.cs
- MethodSignatureGenerator.cs
- ModelVisual3D.cs
- DynamicFilterExpression.cs
- InteropExecutor.cs
- ParameterElement.cs
- EpmCustomContentWriterNodeData.cs
- xml.cs
- XmlSchemaImporter.cs
- RegexCode.cs
- ButtonFieldBase.cs
- Int32Converter.cs
- HealthMonitoringSectionHelper.cs
- SqlSelectStatement.cs
- DesignTimeVisibleAttribute.cs
- FormatConvertedBitmap.cs
- DotExpr.cs
- SpStreamWrapper.cs
- Transform3D.cs
- clipboard.cs
- DesignerDataTableBase.cs
- XslTransform.cs
- FontStyles.cs
- TextElementCollection.cs
- CommandDesigner.cs
- WindowsListViewItemCheckBox.cs
- ProfileModule.cs
- DiscardableAttribute.cs