Code:
/ FX-1434 / FX-1434 / 1.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
- UTF7Encoding.cs
- TextElementEnumerator.cs
- LabelLiteral.cs
- FixedLineResult.cs
- ListViewDesigner.cs
- JumpItem.cs
- CharacterString.cs
- GeneralTransform3DTo2DTo3D.cs
- CheckBoxPopupAdapter.cs
- SplineQuaternionKeyFrame.cs
- DataBinder.cs
- webclient.cs
- PreloadedPackages.cs
- ElementsClipboardData.cs
- codemethodreferenceexpression.cs
- GridViewHeaderRowPresenter.cs
- Regex.cs
- PathNode.cs
- UserControlCodeDomTreeGenerator.cs
- ResourcesBuildProvider.cs
- SqlConnection.cs
- ChannelPoolSettingsElement.cs
- Image.cs
- ClientFormsIdentity.cs
- ScriptReference.cs
- DesignerCatalogPartChrome.cs
- WorkflowDesigner.cs
- OrthographicCamera.cs
- Panel.cs
- CurrentChangedEventManager.cs
- ComNativeDescriptor.cs
- Socket.cs
- DataObjectMethodAttribute.cs
- TokenBasedSet.cs
- RectAnimation.cs
- HostProtectionPermission.cs
- DataGridTextBox.cs
- AlgoModule.cs
- DbDataReader.cs
- CompositeControl.cs
- DocumentViewerAutomationPeer.cs
- RegistrySecurity.cs
- AvTrace.cs
- WebUtil.cs
- safelink.cs
- QilNode.cs
- OleDbStruct.cs
- WinFormsSpinner.cs
- SchemaElementDecl.cs
- ToolboxComponentsCreatingEventArgs.cs
- DataGridViewButtonColumn.cs
- EditorZone.cs
- LineSegment.cs
- ObjectNavigationPropertyMapping.cs
- SpotLight.cs
- MessageQueueKey.cs
- FileDialogPermission.cs
- TcpChannelListener.cs
- EnumerableCollectionView.cs
- HashStream.cs
- VirtualPath.cs
- WebPartEditorOkVerb.cs
- XmlILTrace.cs
- PropertyChangingEventArgs.cs
- EditingMode.cs
- SkinBuilder.cs
- TypeToken.cs
- WrapPanel.cs
- ChildChangedEventArgs.cs
- Paragraph.cs
- PasswordPropertyTextAttribute.cs
- sqlmetadatafactory.cs
- SqlDataAdapter.cs
- HtmlTextArea.cs
- XmlIncludeAttribute.cs
- SqlXmlStorage.cs
- XmlReflectionMember.cs
- Button.cs
- SqlServices.cs
- HttpProcessUtility.cs
- CompositeScriptReference.cs
- MulticastDelegate.cs
- GroupStyle.cs
- SamlConditions.cs
- Int64KeyFrameCollection.cs
- XmlTypeMapping.cs
- SafeSecurityHelper.cs
- ImmutablePropertyDescriptorGridEntry.cs
- UniformGrid.cs
- EnvelopedPkcs7.cs
- FixUpCollection.cs
- SubclassTypeValidatorAttribute.cs
- Globals.cs
- ConfigurationValue.cs
- HtmlImage.cs
- DataTemplateSelector.cs
- FunctionNode.cs
- OperationAbortedException.cs
- QuotedPrintableStream.cs
- DataGridViewColumnStateChangedEventArgs.cs