Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SettingsSavedEventArgs.cs
- SQLMembershipProvider.cs
- ColorContextHelper.cs
- ArrayWithOffset.cs
- _Connection.cs
- CookielessData.cs
- updateconfighost.cs
- CaseInsensitiveComparer.cs
- AttributeCollection.cs
- CacheMode.cs
- TraceUtility.cs
- BindingOperations.cs
- MetabaseServerConfig.cs
- ScriptResourceAttribute.cs
- CssStyleCollection.cs
- SpecialNameAttribute.cs
- StateFinalizationActivity.cs
- TextServicesDisplayAttribute.cs
- EncoderFallback.cs
- ToolboxComponentsCreatingEventArgs.cs
- IPEndPointCollection.cs
- HierarchicalDataBoundControlAdapter.cs
- TemplateNameScope.cs
- WebPartEditorApplyVerb.cs
- SharedPerformanceCounter.cs
- CodeGenerator.cs
- SwitchElementsCollection.cs
- WpfSharedBamlSchemaContext.cs
- UniformGrid.cs
- DataStreamFromComStream.cs
- HttpContext.cs
- AutomationAttributeInfo.cs
- EditorZoneBase.cs
- SchemaElementDecl.cs
- OutputCacheSettingsSection.cs
- ExponentialEase.cs
- RootDesignerSerializerAttribute.cs
- WindowsTreeView.cs
- MaskInputRejectedEventArgs.cs
- FillBehavior.cs
- UserNameSecurityTokenParameters.cs
- FixedSOMElement.cs
- GlobalProxySelection.cs
- CommandEventArgs.cs
- OneOfScalarConst.cs
- RoutedEvent.cs
- ColorBlend.cs
- ZipIOCentralDirectoryFileHeader.cs
- IndexedSelectQueryOperator.cs
- WebPartHeaderCloseVerb.cs
- EncoderBestFitFallback.cs
- PageSettings.cs
- DataGridViewCellCollection.cs
- SupportedAddressingMode.cs
- XmlWhitespace.cs
- ApplicationGesture.cs
- DataListCommandEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- RemotingSurrogateSelector.cs
- MenuDesigner.cs
- DataViewListener.cs
- SymbolPair.cs
- Convert.cs
- Color.cs
- ByteStack.cs
- MergePropertyDescriptor.cs
- NamedPermissionSet.cs
- TypedMessageConverter.cs
- ParseNumbers.cs
- SmiRecordBuffer.cs
- ErasingStroke.cs
- DesignerProperties.cs
- FrameSecurityDescriptor.cs
- SamlDelegatingWriter.cs
- TextParaLineResult.cs
- TemplateBindingExpressionConverter.cs
- RoutedEvent.cs
- PolyLineSegmentFigureLogic.cs
- cookiecollection.cs
- DataSourceControlBuilder.cs
- TargetInvocationException.cs
- RowCache.cs
- AccessViolationException.cs
- ByteStream.cs
- QilStrConcatenator.cs
- ServiceProviders.cs
- ProviderSettings.cs
- DataSourceExpressionCollection.cs
- HttpStreamXmlDictionaryReader.cs
- HashCodeCombiner.cs
- PeerNameRecordCollection.cs
- XPathChildIterator.cs
- FtpWebResponse.cs
- Int32Rect.cs
- ToolboxItemAttribute.cs
- WCFModelStrings.Designer.cs
- RegexTree.cs
- ConvertBinder.cs
- DispatcherFrame.cs
- ConfigurationManagerInternal.cs