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
- KerberosTicketHashIdentifierClause.cs
- ChangeInterceptorAttribute.cs
- XomlCompilerParameters.cs
- EncryptedType.cs
- ButtonBaseAutomationPeer.cs
- documentsequencetextcontainer.cs
- EncryptedType.cs
- oledbmetadatacolumnnames.cs
- MouseActionValueSerializer.cs
- HttpCookieCollection.cs
- ModelFunction.cs
- UserPreferenceChangingEventArgs.cs
- DefaultMemberAttribute.cs
- UrlMappingCollection.cs
- DataGridColumn.cs
- HyperLinkField.cs
- XamlWriter.cs
- ParallelRangeManager.cs
- ListItemsCollectionEditor.cs
- BackgroundWorker.cs
- PrintEvent.cs
- AnchorEditor.cs
- IApplicationTrustManager.cs
- SqlCacheDependencyDatabase.cs
- GroupAggregateExpr.cs
- PolicyImporterElementCollection.cs
- ISessionStateStore.cs
- MemberBinding.cs
- CacheSection.cs
- ListView.cs
- FontClient.cs
- StateMachine.cs
- HttpCachePolicyElement.cs
- FederatedMessageSecurityOverHttpElement.cs
- SortDescriptionCollection.cs
- AsyncPostBackErrorEventArgs.cs
- ViewRendering.cs
- DataGridCommandEventArgs.cs
- ApplicationDirectory.cs
- WebReferencesBuildProvider.cs
- TextDocumentView.cs
- ObjectDataSourceFilteringEventArgs.cs
- ObjectSet.cs
- Point4D.cs
- CheckBoxStandardAdapter.cs
- StrokeCollectionDefaultValueFactory.cs
- DataObjectEventArgs.cs
- TemplatedMailWebEventProvider.cs
- DesignerVerbCollection.cs
- RTLAwareMessageBox.cs
- ChangeInterceptorAttribute.cs
- ConnectionsZoneAutoFormat.cs
- FactoryGenerator.cs
- SettingsSavedEventArgs.cs
- WebPartDisplayModeEventArgs.cs
- ToolBar.cs
- GPPOINT.cs
- RandomNumberGenerator.cs
- XmlIlTypeHelper.cs
- FormatSettings.cs
- EmptyEnumerator.cs
- WindowsRichEdit.cs
- SmtpSection.cs
- DesignerImageAdapter.cs
- VisualProxy.cs
- XmlSerializer.cs
- ApplicationServiceManager.cs
- AssemblyResourceLoader.cs
- Funcletizer.cs
- DataListItem.cs
- SingleStorage.cs
- ConnectionStringsExpressionBuilder.cs
- JobInputBins.cs
- DataGridViewImageCell.cs
- EventItfInfo.cs
- TextTreeUndoUnit.cs
- CompoundFileDeflateTransform.cs
- PointAnimation.cs
- ScrollViewer.cs
- TableLayout.cs
- Hex.cs
- DictionaryEditChange.cs
- EndCreateSecurityTokenRequest.cs
- CodeTypeParameterCollection.cs
- Registration.cs
- HtmlInputHidden.cs
- ServiceModelStringsVersion1.cs
- DataGridViewEditingControlShowingEventArgs.cs
- EncodingTable.cs
- SctClaimDictionary.cs
- QueryPageSettingsEventArgs.cs
- ObjectKeyFrameCollection.cs
- EventLogPermissionHolder.cs
- UrlUtility.cs
- HttpCapabilitiesEvaluator.cs
- Pair.cs
- CharacterBufferReference.cs
- AsyncPostBackErrorEventArgs.cs
- ListViewAutomationPeer.cs
- TextEndOfLine.cs