Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / ReadOnlyAttribute.cs / 1305376 / ReadOnlyAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies whether the property this attribute is bound to
/// is read-only or read/write.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class ReadOnlyAttribute : Attribute {
private bool isReadOnly = false;
///
///
/// Specifies that the property this attribute is bound to is read-only and
/// cannot be modified in the server explorer. This field is
/// read-only.
///
///
public static readonly ReadOnlyAttribute Yes = new ReadOnlyAttribute(true);
///
///
/// Specifies that the property this attribute is bound to is read/write and can
/// be modified at design time. This field is read-only.
///
///
public static readonly ReadOnlyAttribute No = new ReadOnlyAttribute(false);
///
///
/// Specifies the default value for the , which is , that is,
/// the property this attribute is bound to is read/write. This field is read-only.
///
///
public static readonly ReadOnlyAttribute Default = No;
///
///
/// Initializes a new instance of the class.
///
///
public ReadOnlyAttribute(bool isReadOnly) {
this.isReadOnly = isReadOnly;
}
///
///
/// Gets a value indicating whether the property this attribute is bound to is
/// read-only.
///
///
public bool IsReadOnly {
get {
return isReadOnly;
}
}
///
///
///
public override bool Equals(object value) {
if (this == value) {
return true;
}
ReadOnlyAttribute other = value as ReadOnlyAttribute;
return other != null && other.IsReadOnly == IsReadOnly;
}
///
///
/// Returns the hashcode for this object.
///
///
public override int GetHashCode() {
return base.GetHashCode();
}
///
///
///
/// Determines if this attribute is the default.
///
///
public override bool IsDefaultAttribute() {
return (this.IsReadOnly == Default.IsReadOnly);
}
}
}
// 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
- XmlNamedNodeMap.cs
- WebHttpSecurityModeHelper.cs
- XmlSchemaAttributeGroup.cs
- IPGlobalProperties.cs
- TileBrush.cs
- SqlServer2KCompatibilityAnnotation.cs
- BackgroundFormatInfo.cs
- XmlObjectSerializerReadContextComplex.cs
- CompiledXpathExpr.cs
- SqlStatistics.cs
- ConfigurationErrorsException.cs
- DelimitedListTraceListener.cs
- UnsafeNativeMethods.cs
- ContactManager.cs
- MatrixUtil.cs
- GlyphingCache.cs
- ResolveDuplexAsyncResult.cs
- SecUtil.cs
- WebServiceData.cs
- WindowsProgressbar.cs
- _NativeSSPI.cs
- PrimitiveXmlSerializers.cs
- FreeFormDragDropManager.cs
- SemanticKeyElement.cs
- Int16Animation.cs
- DriveInfo.cs
- ReadingWritingEntityEventArgs.cs
- OpenTypeCommon.cs
- ViewGenerator.cs
- FlowLayoutPanel.cs
- OleDbParameter.cs
- RequiredFieldValidator.cs
- WebEncodingValidatorAttribute.cs
- HttpRawResponse.cs
- SecureEnvironment.cs
- DetailsViewCommandEventArgs.cs
- QueryInterceptorAttribute.cs
- TimeZone.cs
- PreservationFileReader.cs
- FlowSwitchLink.cs
- ClientBuildManager.cs
- UrlAuthorizationModule.cs
- HttpRuntime.cs
- XamlParser.cs
- ImportCatalogPart.cs
- ControlBuilderAttribute.cs
- CryptographicAttribute.cs
- TableProviderWrapper.cs
- NameSpaceExtractor.cs
- ValueOfAction.cs
- RightNameExpirationInfoPair.cs
- HealthMonitoringSectionHelper.cs
- WindowsTreeView.cs
- HostingEnvironmentWrapper.cs
- Operand.cs
- ObjectNavigationPropertyMapping.cs
- LinkUtilities.cs
- SchemaSetCompiler.cs
- RemoveFromCollection.cs
- VariantWrapper.cs
- WeakEventTable.cs
- CompositeDuplexElement.cs
- CodeDirectiveCollection.cs
- EmbossBitmapEffect.cs
- InstalledVoice.cs
- HostingEnvironmentException.cs
- MultilineStringConverter.cs
- SmiEventSink.cs
- SizeAnimationUsingKeyFrames.cs
- ArgumentException.cs
- LocationUpdates.cs
- IMembershipProvider.cs
- StringAnimationBase.cs
- DefaultParameterValueAttribute.cs
- AssociationSetEnd.cs
- ProfileService.cs
- typedescriptorpermissionattribute.cs
- DataBindingExpressionBuilder.cs
- WeakReferenceEnumerator.cs
- OleDbRowUpdatingEvent.cs
- CustomCategoryAttribute.cs
- ContextBase.cs
- RowUpdatingEventArgs.cs
- PhoneCall.cs
- SqlXml.cs
- StringUtil.cs
- relpropertyhelper.cs
- DataViewListener.cs
- DisplayToken.cs
- CalendarSelectionChangedEventArgs.cs
- ServerIdentity.cs
- UnmanagedBitmapWrapper.cs
- DeferredRunTextReference.cs
- UnsafeCollabNativeMethods.cs
- keycontainerpermission.cs
- XmlSchemas.cs
- WindowInteractionStateTracker.cs
- AsymmetricAlgorithm.cs
- RuleSettings.cs
- SqlTriggerContext.cs