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
- KerberosSecurityTokenProvider.cs
- DbProviderFactoriesConfigurationHandler.cs
- HitTestWithPointDrawingContextWalker.cs
- HtmlInputHidden.cs
- Vars.cs
- Vector3D.cs
- FixUp.cs
- SafeEventLogReadHandle.cs
- StaticExtension.cs
- WrappingXamlSchemaContext.cs
- UnsafeCollabNativeMethods.cs
- ListViewInsertionMark.cs
- XpsResourcePolicy.cs
- Stroke2.cs
- MenuItemAutomationPeer.cs
- WizardStepBase.cs
- FontNamesConverter.cs
- ApplicationHost.cs
- SecurityTokenProvider.cs
- ComboBoxItem.cs
- PlainXmlWriter.cs
- IOThreadTimer.cs
- FieldBuilder.cs
- CalendarDateRange.cs
- SchemaInfo.cs
- FillErrorEventArgs.cs
- PseudoWebRequest.cs
- MemoryFailPoint.cs
- FixUp.cs
- Helper.cs
- SystemTcpStatistics.cs
- ResizeGrip.cs
- StructureChangedEventArgs.cs
- LinqDataSourceDeleteEventArgs.cs
- DataGridColumn.cs
- StructuredProperty.cs
- PointAnimation.cs
- PiiTraceSource.cs
- Brushes.cs
- SafeNativeMethods.cs
- KeyInstance.cs
- FormViewDeleteEventArgs.cs
- ShaderEffect.cs
- ViewBase.cs
- DrawingContextWalker.cs
- BindingListCollectionView.cs
- EdmConstants.cs
- WeakHashtable.cs
- CaseInsensitiveOrdinalStringComparer.cs
- NumberSubstitution.cs
- InputScope.cs
- ObjectListFieldsPage.cs
- ExecutionProperties.cs
- PagedControl.cs
- XPathDescendantIterator.cs
- TemplatedControlDesigner.cs
- BaseTemplateBuildProvider.cs
- DeobfuscatingStream.cs
- IndicFontClient.cs
- XamlTreeBuilderBamlRecordWriter.cs
- MarkupProperty.cs
- SyntaxCheck.cs
- DataMemberFieldConverter.cs
- FixedSOMTableCell.cs
- AliasExpr.cs
- ProxyManager.cs
- CqlParserHelpers.cs
- SoapSchemaExporter.cs
- XmlResolver.cs
- ContextInformation.cs
- AnnotationHelper.cs
- SHA1CryptoServiceProvider.cs
- AdornedElementPlaceholder.cs
- ReadonlyMessageFilter.cs
- InstallHelper.cs
- ObjectDataSourceDesigner.cs
- ContextStaticAttribute.cs
- DataTrigger.cs
- MsmqReceiveHelper.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SessionIDManager.cs
- TemplateControlBuildProvider.cs
- ShapingWorkspace.cs
- KeyToListMap.cs
- TextFormatterImp.cs
- StickyNoteHelper.cs
- InvariantComparer.cs
- Control.cs
- TransactionManager.cs
- bidPrivateBase.cs
- CodeTypeMemberCollection.cs
- DateTimePicker.cs
- UserPreferenceChangedEventArgs.cs
- PropertyExpression.cs
- VisualTreeUtils.cs
- OperatingSystem.cs
- XmlNamespaceMappingCollection.cs
- LogicalExpr.cs
- controlskin.cs
- SystemIcmpV4Statistics.cs