Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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(); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridTable.cs
- WindowsScroll.cs
- ScriptingRoleServiceSection.cs
- GroupBox.cs
- ImageMap.cs
- CreatingCookieEventArgs.cs
- SpeechSeg.cs
- DecoderNLS.cs
- ImportContext.cs
- GridViewDeletedEventArgs.cs
- AstNode.cs
- ClusterSafeNativeMethods.cs
- SQLBytes.cs
- NativeMethodsCLR.cs
- PropertyValue.cs
- BitmapDecoder.cs
- StylusPointPropertyInfo.cs
- Util.cs
- UnsafeNativeMethods.cs
- AliasedExpr.cs
- MetadataItemEmitter.cs
- SafeCryptoHandles.cs
- MessageSecurityOverTcp.cs
- MergablePropertyAttribute.cs
- Int64.cs
- MergeEnumerator.cs
- SystemColors.cs
- IMembershipProvider.cs
- DataSetUtil.cs
- ControlsConfig.cs
- AssemblySettingAttributes.cs
- DispatcherHookEventArgs.cs
- SQLBinaryStorage.cs
- ControllableStoryboardAction.cs
- WebPartConnectionCollection.cs
- ListCommandEventArgs.cs
- WindowsComboBox.cs
- HttpUnhandledOperationInvoker.cs
- TabPage.cs
- HandleCollector.cs
- BindingValueChangedEventArgs.cs
- HelpHtmlBuilder.cs
- Duration.cs
- AddInAttribute.cs
- DoubleConverter.cs
- TypeConverterHelper.cs
- DbSetClause.cs
- CollaborationHelperFunctions.cs
- mediaeventshelper.cs
- Constraint.cs
- CalloutQueueItem.cs
- TextSpan.cs
- SharedUtils.cs
- NavigationFailedEventArgs.cs
- BasicHttpMessageSecurityElement.cs
- Visual.cs
- ImageSource.cs
- __ComObject.cs
- NotSupportedException.cs
- ParameterCollection.cs
- MenuItemBinding.cs
- AttributeEmitter.cs
- URI.cs
- TextBox.cs
- SqlRowUpdatingEvent.cs
- StylusLogic.cs
- Font.cs
- DbBuffer.cs
- RepeaterItem.cs
- PageParser.cs
- ScalarConstant.cs
- Keyboard.cs
- SourceInterpreter.cs
- SqlMethodCallConverter.cs
- PathGeometry.cs
- ToolStripScrollButton.cs
- ComNativeDescriptor.cs
- SchemaMapping.cs
- RecognizerInfo.cs
- PresentationAppDomainManager.cs
- Html32TextWriter.cs
- IdentifierService.cs
- HtmlInputControl.cs
- QueryContext.cs
- PropertiesTab.cs
- PermissionSetEnumerator.cs
- RelationshipManager.cs
- SqlInfoMessageEvent.cs
- Camera.cs
- Opcode.cs
- WindowsTreeView.cs
- XPathParser.cs
- Rfc2898DeriveBytes.cs
- Marshal.cs
- XamlSerializer.cs
- WindowsSspiNegotiation.cs
- StringWriter.cs
- TableLayoutPanelResizeGlyph.cs
- DeviceSpecificDialogCachedState.cs
- ListViewInsertionMark.cs