Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / ReadOnlyAttribute.cs / 1 / 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
- DataGridViewTextBoxColumn.cs
- XPathNavigatorReader.cs
- BigInt.cs
- PageAsyncTask.cs
- FtpWebRequest.cs
- WebPartExportVerb.cs
- InvalidFilterCriteriaException.cs
- QualifiedId.cs
- FormViewModeEventArgs.cs
- BookmarkResumptionRecord.cs
- PackWebRequestFactory.cs
- MetadataItem_Static.cs
- MenuAdapter.cs
- GridItemProviderWrapper.cs
- Floater.cs
- SqlCacheDependencySection.cs
- StorageEntitySetMapping.cs
- ArgumentNullException.cs
- FontSourceCollection.cs
- PersonalizableTypeEntry.cs
- MenuItemCollection.cs
- SqlUDTStorage.cs
- X500Name.cs
- XPathExpr.cs
- UnmanagedHandle.cs
- InstanceKeyCollisionException.cs
- SamlAuthenticationClaimResource.cs
- VisualProxy.cs
- TypeToArgumentTypeConverter.cs
- EdmComplexTypeAttribute.cs
- PropertyDescriptorComparer.cs
- ToolboxItemCollection.cs
- NativeWindow.cs
- PageSettings.cs
- DesignerDataSourceView.cs
- CompilerError.cs
- DBProviderConfigurationHandler.cs
- COM2ColorConverter.cs
- DiagnosticTraceSource.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- WebBrowser.cs
- ConfigurationManagerHelperFactory.cs
- TransformerConfigurationWizardBase.cs
- EllipseGeometry.cs
- WebPartManager.cs
- CreateUserWizardStep.cs
- RequestNavigateEventArgs.cs
- RootBuilder.cs
- ConstrainedDataObject.cs
- EdmPropertyAttribute.cs
- ResourceDescriptionAttribute.cs
- Rectangle.cs
- Pool.cs
- ExpressionQuoter.cs
- DiscardableAttribute.cs
- ObfuscateAssemblyAttribute.cs
- UnsafeNativeMethods.cs
- PublisherIdentityPermission.cs
- AxisAngleRotation3D.cs
- WebServiceData.cs
- XmlProcessingInstruction.cs
- CompositeKey.cs
- ProcessModelInfo.cs
- TranslateTransform.cs
- ReadOnlyHierarchicalDataSource.cs
- DmlSqlGenerator.cs
- BitmapPalettes.cs
- ThreadAbortException.cs
- XmlNodeChangedEventManager.cs
- DataGridViewCellStyle.cs
- DtdParser.cs
- DmlSqlGenerator.cs
- CacheMode.cs
- SupportsEventValidationAttribute.cs
- TriggerAction.cs
- BoundColumn.cs
- OleDbTransaction.cs
- Button.cs
- SchemaType.cs
- SequenceDesignerAccessibleObject.cs
- ColumnPropertiesGroup.cs
- ListBase.cs
- FreezableOperations.cs
- MenuItemStyle.cs
- NavigationService.cs
- ContainsRowNumberChecker.cs
- SecurityMode.cs
- OciLobLocator.cs
- ToolStripComboBox.cs
- SHA512.cs
- ScriptResourceHandler.cs
- UnmanagedMemoryStreamWrapper.cs
- WinEventWrap.cs
- DeflateEmulationStream.cs
- Grant.cs
- CodeMethodInvokeExpression.cs
- MailHeaderInfo.cs
- DataServiceContext.cs
- RegexCompilationInfo.cs
- DataFormat.cs