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; ////// [AttributeUsage(AttributeTargets.All)] public sealed class ReadOnlyAttribute : Attribute { private bool isReadOnly = false; ///Specifies whether the property this attribute is bound to /// is read-only or read/write. ////// public static readonly ReadOnlyAttribute Yes = new ReadOnlyAttribute(true); ////// 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 No = new ReadOnlyAttribute(false); ////// 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 Default = No; ////// 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 ReadOnlyAttribute(bool isReadOnly) { this.isReadOnly = isReadOnly; } ////// Initializes a new instance of the ///class. /// /// public bool IsReadOnly { get { return isReadOnly; } } ////// Gets a value indicating whether the property this attribute is bound to is /// read-only. /// ////// /// public override bool Equals(object value) { if (this == value) { return true; } ReadOnlyAttribute other = value as ReadOnlyAttribute; return other != null && other.IsReadOnly == IsReadOnly; } ////// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// /// public override bool IsDefaultAttribute() { return (this.IsReadOnly == Default.IsReadOnly); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Determines if this attribute is the default. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All)] public sealed class ReadOnlyAttribute : Attribute { private bool isReadOnly = false; ///Specifies whether the property this attribute is bound to /// is read-only or read/write. ////// public static readonly ReadOnlyAttribute Yes = new ReadOnlyAttribute(true); ////// 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 No = new ReadOnlyAttribute(false); ////// 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 Default = No; ////// 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 ReadOnlyAttribute(bool isReadOnly) { this.isReadOnly = isReadOnly; } ////// Initializes a new instance of the ///class. /// /// public bool IsReadOnly { get { return isReadOnly; } } ////// Gets a value indicating whether the property this attribute is bound to is /// read-only. /// ////// /// public override bool Equals(object value) { if (this == value) { return true; } ReadOnlyAttribute other = value as ReadOnlyAttribute; return other != null && other.IsReadOnly == IsReadOnly; } ////// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// /// public override bool IsDefaultAttribute() { return (this.IsReadOnly == Default.IsReadOnly); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Determines if this attribute is the default. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DrawingImage.cs
- AsymmetricKeyExchangeFormatter.cs
- AnimationClock.cs
- AppDomainFactory.cs
- DependencyObjectProvider.cs
- Image.cs
- ListControlBoundActionList.cs
- LinearGradientBrush.cs
- Timeline.cs
- GridItem.cs
- CompModSwitches.cs
- TableStyle.cs
- LogSwitch.cs
- DataGridViewComboBoxCell.cs
- CriticalHandle.cs
- HttpContextWrapper.cs
- WebPartEditorCancelVerb.cs
- ImageSource.cs
- recordstate.cs
- AttributeProviderAttribute.cs
- PropertyChangedEventArgs.cs
- FormViewInsertedEventArgs.cs
- ReachPrintTicketSerializer.cs
- SpotLight.cs
- ApplicationActivator.cs
- SemanticResolver.cs
- DbProviderFactoriesConfigurationHandler.cs
- XsdDateTime.cs
- IsolatedStorageException.cs
- SQLBinary.cs
- JsonMessageEncoderFactory.cs
- SendMailErrorEventArgs.cs
- QilInvoke.cs
- SingleObjectCollection.cs
- ContentPresenter.cs
- ConfigurationSettings.cs
- QueryOpeningEnumerator.cs
- XmlElementList.cs
- CodeArrayIndexerExpression.cs
- ConfigurationLocation.cs
- ToolStripLocationCancelEventArgs.cs
- AccessDataSource.cs
- ParserContext.cs
- ListViewSelectEventArgs.cs
- XmlCharCheckingReader.cs
- SoapSchemaImporter.cs
- DbProviderFactory.cs
- AttributeData.cs
- SizeConverter.cs
- ListItemConverter.cs
- KeyValueInternalCollection.cs
- ImageField.cs
- ExtractedStateEntry.cs
- FileAuthorizationModule.cs
- WebPartConnectionsConfigureVerb.cs
- ValidatedControlConverter.cs
- SqlTriggerContext.cs
- DoubleIndependentAnimationStorage.cs
- GroupDescription.cs
- ResourceDisplayNameAttribute.cs
- DesignerForm.cs
- SqlServices.cs
- InvalidateEvent.cs
- PropertyChangeTracker.cs
- SafeRightsManagementQueryHandle.cs
- EndEvent.cs
- XsltLibrary.cs
- DbConnectionStringBuilder.cs
- DictionaryMarkupSerializer.cs
- CqlIdentifiers.cs
- SHA384.cs
- RootBrowserWindow.cs
- DbConnectionFactory.cs
- ReliableRequestSessionChannel.cs
- AssociationTypeEmitter.cs
- CheckBoxBaseAdapter.cs
- FullTrustAssemblyCollection.cs
- ReaderWriterLock.cs
- CommentGlyph.cs
- EncoderExceptionFallback.cs
- FixedFlowMap.cs
- WebAdminConfigurationHelper.cs
- WCFServiceClientProxyGenerator.cs
- EntityUtil.cs
- RequiredFieldValidator.cs
- ExpressionBinding.cs
- XmlSchema.cs
- ClassHandlersStore.cs
- AssertSection.cs
- Enumerable.cs
- ComponentRenameEvent.cs
- ScaleTransform.cs
- ResourceDescriptionAttribute.cs
- SectionInformation.cs
- TransformGroup.cs
- DropDownList.cs
- AnnotationComponentManager.cs
- Exceptions.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ThemeableAttribute.cs