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
- ObjectStorage.cs
- FontStretches.cs
- RepeatEnumerable.cs
- PageThemeCodeDomTreeGenerator.cs
- WebAdminConfigurationHelper.cs
- GeneralTransformCollection.cs
- NativeMethodsCLR.cs
- EventDescriptor.cs
- Socket.cs
- Color.cs
- OptionUsage.cs
- XpsS0ValidatingLoader.cs
- Literal.cs
- ImageCodecInfo.cs
- LinearKeyFrames.cs
- Clock.cs
- TreeNodeMouseHoverEvent.cs
- TypeResolver.cs
- control.ime.cs
- RoutedEventConverter.cs
- DesignerCategoryAttribute.cs
- AsyncOperation.cs
- UITypeEditor.cs
- Compiler.cs
- XPathItem.cs
- Parameter.cs
- MsmqBindingFilter.cs
- SqlConnectionHelper.cs
- HttpProfileBase.cs
- DataGridViewCellCollection.cs
- ExtendedProtectionPolicyTypeConverter.cs
- StylusEventArgs.cs
- SQlBooleanStorage.cs
- ReferentialConstraint.cs
- Transform3DGroup.cs
- Win32SafeHandles.cs
- DiscreteKeyFrames.cs
- RepeatButtonAutomationPeer.cs
- VariableQuery.cs
- MruCache.cs
- GridViewEditEventArgs.cs
- SystemColorTracker.cs
- SystemMulticastIPAddressInformation.cs
- SvcFileManager.cs
- documentsequencetextview.cs
- CharacterBuffer.cs
- Int16Animation.cs
- SizeF.cs
- AudioFormatConverter.cs
- SessionStateContainer.cs
- DbConnectionStringBuilder.cs
- DataGridViewColumn.cs
- DetailsViewUpdateEventArgs.cs
- translator.cs
- AuthenticationModulesSection.cs
- MappingException.cs
- HashCryptoHandle.cs
- DataAdapter.cs
- BitmapCache.cs
- ReliabilityContractAttribute.cs
- ZipArchive.cs
- ExceptionRoutedEventArgs.cs
- EDesignUtil.cs
- SystemInfo.cs
- UnmanagedBitmapWrapper.cs
- HttpFileCollectionWrapper.cs
- LoginViewDesigner.cs
- DBConcurrencyException.cs
- MasterPageCodeDomTreeGenerator.cs
- CallTemplateAction.cs
- SecUtil.cs
- DataGridViewCheckBoxCell.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- SiteMapHierarchicalDataSourceView.cs
- XmlTextEncoder.cs
- LocatorPartList.cs
- ObjectDataSourceDisposingEventArgs.cs
- BindingWorker.cs
- DockAndAnchorLayout.cs
- CustomErrorCollection.cs
- AdapterUtil.cs
- HostProtectionPermission.cs
- _AutoWebProxyScriptWrapper.cs
- AspCompat.cs
- TypefaceMetricsCache.cs
- AssemblyCollection.cs
- SoapInteropTypes.cs
- WorkflowInstanceContextProvider.cs
- SerialPinChanges.cs
- BitmapEffectDrawingContextState.cs
- Connection.cs
- StreamHelper.cs
- ConnectAlgorithms.cs
- EntityProviderServices.cs
- SessionSwitchEventArgs.cs
- WindowsHyperlink.cs
- securitycriticaldata.cs
- LeftCellWrapper.cs
- ScrollBar.cs
- DBDataPermission.cs