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
- PageSettings.cs
- XmlStringTable.cs
- MimeWriter.cs
- SkipStoryboardToFill.cs
- FixedFlowMap.cs
- Typography.cs
- MediaPlayerState.cs
- SerializeAbsoluteContext.cs
- CopyEncoder.cs
- Privilege.cs
- QuotedPrintableStream.cs
- WebServiceResponseDesigner.cs
- HttpAsyncResult.cs
- DataGridViewCheckBoxCell.cs
- EventSource.cs
- ResourcePart.cs
- TreeNodeEventArgs.cs
- Pair.cs
- CharEnumerator.cs
- MSAAWinEventWrap.cs
- TextBoxRenderer.cs
- FormViewDeletedEventArgs.cs
- InputManager.cs
- AutoGeneratedField.cs
- TextEmbeddedObject.cs
- DebugView.cs
- SelectionRange.cs
- serverconfig.cs
- SplineKeyFrames.cs
- CompilerGeneratedAttribute.cs
- DataTableReaderListener.cs
- WebPartCloseVerb.cs
- XmlNodeList.cs
- InstanceDataCollection.cs
- WebControlAdapter.cs
- ExpressionConverter.cs
- ApplicationInfo.cs
- ModelPerspective.cs
- MetadataItemSerializer.cs
- DataControlHelper.cs
- InertiaExpansionBehavior.cs
- TypeDescriptor.cs
- WindowsStreamSecurityBindingElement.cs
- ConfigXmlDocument.cs
- SqlNodeTypeOperators.cs
- ValidatingReaderNodeData.cs
- ContractComponent.cs
- GenerateTemporaryTargetAssembly.cs
- NameSpaceExtractor.cs
- InternalControlCollection.cs
- DataGridViewHitTestInfo.cs
- ListView.cs
- GACMembershipCondition.cs
- DataGridViewImageColumn.cs
- CurrentChangingEventArgs.cs
- Span.cs
- ChannelBinding.cs
- SemanticValue.cs
- Drawing.cs
- ExtendedProperty.cs
- KnownColorTable.cs
- EventRecord.cs
- ControlEvent.cs
- TemplateLookupAction.cs
- ReadOnlyTernaryTree.cs
- HtmlProps.cs
- XPathCompileException.cs
- COM2Properties.cs
- XmlChildNodes.cs
- OleCmdHelper.cs
- AttachedPropertyDescriptor.cs
- ButtonBase.cs
- SqlConnectionHelper.cs
- WeakReadOnlyCollection.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- ImageKeyConverter.cs
- XmlSchemaObjectTable.cs
- ScalarType.cs
- CodeParameterDeclarationExpression.cs
- BindingObserver.cs
- StorageEntityTypeMapping.cs
- AuthenticateEventArgs.cs
- ForEachAction.cs
- AnnotationAdorner.cs
- GotoExpression.cs
- Lease.cs
- MemberHolder.cs
- WorkItem.cs
- Polyline.cs
- MemberProjectedSlot.cs
- ContentElementAutomationPeer.cs
- RemotingAttributes.cs
- HierarchicalDataSourceControl.cs
- DoubleLink.cs
- Parameter.cs
- ParameterRetriever.cs
- ClientConvert.cs
- SqlProviderManifest.cs
- CssStyleCollection.cs
- ValidatedControlConverter.cs