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
- ViewStateModeByIdAttribute.cs
- HttpConfigurationSystem.cs
- BitmapEffectInputData.cs
- ProviderUtil.cs
- NativeMethods.cs
- StreamGeometryContext.cs
- MenuRenderer.cs
- BoundPropertyEntry.cs
- SeverityFilter.cs
- EdmComplexTypeAttribute.cs
- RemotingConfigParser.cs
- StringBuilder.cs
- ParameterReplacerVisitor.cs
- FilteredXmlReader.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- Utilities.cs
- ConfigurationStrings.cs
- ItemCheckEvent.cs
- MouseGesture.cs
- BufferedReadStream.cs
- QfeChecker.cs
- LinkDesigner.cs
- XmlNodeChangedEventArgs.cs
- BoundConstants.cs
- DoubleIndependentAnimationStorage.cs
- UnmanagedMemoryStreamWrapper.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- TypeName.cs
- ChangeProcessor.cs
- XamlSerializerUtil.cs
- SizeChangedEventArgs.cs
- ZipIORawDataFileBlock.cs
- DesigntimeLicenseContextSerializer.cs
- NumberAction.cs
- WmpBitmapEncoder.cs
- ContentOperations.cs
- FindCriteriaCD1.cs
- SafeViewOfFileHandle.cs
- HMACSHA384.cs
- BitHelper.cs
- ListSourceHelper.cs
- DataControlImageButton.cs
- InvalidPropValue.cs
- ListViewEditEventArgs.cs
- DoubleLink.cs
- DataReaderContainer.cs
- SendReply.cs
- BackEase.cs
- GreenMethods.cs
- ExitEventArgs.cs
- PointAnimationUsingKeyFrames.cs
- AudioFormatConverter.cs
- EventProxy.cs
- Helpers.cs
- WizardPanel.cs
- RequestTimeoutManager.cs
- AlignmentYValidation.cs
- ObjectItemAssemblyLoader.cs
- StrokeCollectionConverter.cs
- BasicExpressionVisitor.cs
- ConfigurationPropertyCollection.cs
- MultiAsyncResult.cs
- CorrelationTokenTypeConvertor.cs
- MessageSecurityOverHttp.cs
- WMIGenerator.cs
- DocumentOutline.cs
- FirstQueryOperator.cs
- MouseGestureConverter.cs
- ContextDataSourceView.cs
- WebPartRestoreVerb.cs
- TrustManagerPromptUI.cs
- StringUtil.cs
- TextDecorations.cs
- SerializationObjectManager.cs
- TdsRecordBufferSetter.cs
- XPathSelfQuery.cs
- OdbcHandle.cs
- ConditionalWeakTable.cs
- BorderGapMaskConverter.cs
- DataContext.cs
- MethodAccessException.cs
- GZipStream.cs
- CompilationLock.cs
- Variable.cs
- SpeechUI.cs
- ExpressionBuilderCollection.cs
- BidOverLoads.cs
- securitycriticaldataformultiplegetandset.cs
- StrongNameMembershipCondition.cs
- DataTemplateSelector.cs
- SignatureHelper.cs
- SoapHeaderException.cs
- SwitchElementsCollection.cs
- UIntPtr.cs
- ResourceIDHelper.cs
- HtmlMeta.cs
- Point.cs
- TemplateBindingExpressionConverter.cs
- RuntimeConfigurationRecord.cs
- ResourceIDHelper.cs