Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- SmiEventStream.cs
- TextEvent.cs
- OdbcErrorCollection.cs
- RotateTransform.cs
- DictionaryContent.cs
- Base64Stream.cs
- SafeHandle.cs
- PartDesigner.cs
- UserCancellationException.cs
- XmlAttributeOverrides.cs
- ParserStreamGeometryContext.cs
- SqlBooleanizer.cs
- ValueType.cs
- StreamFormatter.cs
- NativeMethods.cs
- ProcessModelInfo.cs
- SafeHandle.cs
- RegexNode.cs
- CompModHelpers.cs
- ResourceReferenceKeyNotFoundException.cs
- OutputWindow.cs
- DataGridRowsPresenter.cs
- SqlWorkflowPersistenceService.cs
- PartialList.cs
- TransformPatternIdentifiers.cs
- CodeIdentifier.cs
- Rect.cs
- mediapermission.cs
- WebControlAdapter.cs
- FileVersionInfo.cs
- SecurityRuntime.cs
- CultureTable.cs
- EventLogPermissionEntryCollection.cs
- TextEmbeddedObject.cs
- MatrixAnimationUsingKeyFrames.cs
- adornercollection.cs
- PropertyOrder.cs
- Attribute.cs
- IDQuery.cs
- SqlConnectionHelper.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- ObjectSpanRewriter.cs
- CompositionAdorner.cs
- DocumentGridPage.cs
- SettingsPropertyNotFoundException.cs
- DSACryptoServiceProvider.cs
- UnsafeNativeMethodsMilCoreApi.cs
- AssemblyBuilder.cs
- SynchronizingStream.cs
- XmlSchemaAny.cs
- ConditionBrowserDialog.cs
- SetStoryboardSpeedRatio.cs
- CheckBox.cs
- MenuItemCollection.cs
- ReadOnlyDataSourceView.cs
- NamedObject.cs
- WinFormsSpinner.cs
- EntityConnectionStringBuilderItem.cs
- QueryOutputWriter.cs
- TextModifier.cs
- AnalyzedTree.cs
- SoundPlayer.cs
- Socket.cs
- DataStorage.cs
- UserControlAutomationPeer.cs
- IPPacketInformation.cs
- UpdatePanelControlTrigger.cs
- OleDbRowUpdatedEvent.cs
- LostFocusEventManager.cs
- WSSecureConversation.cs
- RuleSettings.cs
- DeleteStoreRequest.cs
- RequestCacheValidator.cs
- SnapLine.cs
- DesignerSerializationOptionsAttribute.cs
- WindowsSolidBrush.cs
- ObjectNotFoundException.cs
- VerificationException.cs
- DropSourceBehavior.cs
- DynamicObjectAccessor.cs
- _Rfc2616CacheValidators.cs
- QilStrConcat.cs
- PlainXmlSerializer.cs
- StreamResourceInfo.cs
- SizeFConverter.cs
- TagPrefixAttribute.cs
- ChannelSinkStacks.cs
- OperationCanceledException.cs
- XmlSerializerOperationGenerator.cs
- TypedElement.cs
- XmlElementList.cs
- AssemblyResourceLoader.cs
- OdbcReferenceCollection.cs
- FocusWithinProperty.cs
- ContainerAction.cs
- IConvertible.cs
- BinaryNode.cs
- MdbDataFileEditor.cs
- ProfileParameter.cs
- DisposableCollectionWrapper.cs