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
- FamilyMap.cs
- RelationshipType.cs
- ReadWriteSpinLock.cs
- WindowsHyperlink.cs
- XmlChildNodes.cs
- GuidelineCollection.cs
- Oid.cs
- TypeViewSchema.cs
- ToolStripCollectionEditor.cs
- CustomWebEventKey.cs
- DeadCharTextComposition.cs
- HostedElements.cs
- XmlAtomicValue.cs
- CodeMethodInvokeExpression.cs
- GradientStop.cs
- PageCodeDomTreeGenerator.cs
- DeploymentExceptionMapper.cs
- UpDownBaseDesigner.cs
- AvTraceFormat.cs
- DeferredTextReference.cs
- SolidBrush.cs
- HttpsHostedTransportConfiguration.cs
- InvalidComObjectException.cs
- DynamicUpdateCommand.cs
- BasicHttpMessageSecurityElement.cs
- PasswordRecovery.cs
- DetailsViewUpdatedEventArgs.cs
- MemberHolder.cs
- HitTestDrawingContextWalker.cs
- HttpRawResponse.cs
- SymLanguageType.cs
- DocumentXPathNavigator.cs
- X509Utils.cs
- CurrencyWrapper.cs
- ValidatingPropertiesEventArgs.cs
- CapacityStreamGeometryContext.cs
- MimeTypeMapper.cs
- ResourceSetExpression.cs
- MULTI_QI.cs
- LambdaCompiler.cs
- MergeFailedEvent.cs
- CookielessHelper.cs
- FontCollection.cs
- XmlImplementation.cs
- DefaultValueAttribute.cs
- CommandEventArgs.cs
- CheckBoxAutomationPeer.cs
- MatchingStyle.cs
- LineSegment.cs
- StreamResourceInfo.cs
- CompensationTokenData.cs
- BuildProvider.cs
- WindowVisualStateTracker.cs
- FileUtil.cs
- BitmapCodecInfoInternal.cs
- ServiceProviders.cs
- Ports.cs
- TextAutomationPeer.cs
- DataBindEngine.cs
- BaseServiceProvider.cs
- PreviewPageInfo.cs
- ResourceProperty.cs
- AssociationSetEnd.cs
- XmlNamedNodeMap.cs
- ContractNamespaceAttribute.cs
- TextServicesPropertyRanges.cs
- ExpressionBuilderCollection.cs
- SystemIPInterfaceStatistics.cs
- XmlDataSourceNodeDescriptor.cs
- AudienceUriMode.cs
- IdentityManager.cs
- RootProfilePropertySettingsCollection.cs
- TraversalRequest.cs
- Closure.cs
- AmbientProperties.cs
- DesignBindingValueUIHandler.cs
- XmlUnspecifiedAttribute.cs
- UserThread.cs
- WindowsComboBox.cs
- ColorMatrix.cs
- _SslStream.cs
- Menu.cs
- ProfilePropertyMetadata.cs
- RequiredFieldValidator.cs
- SQLInt32Storage.cs
- MultipleViewProviderWrapper.cs
- FolderNameEditor.cs
- NavigationFailedEventArgs.cs
- SectionInformation.cs
- _TLSstream.cs
- SafeNativeMethodsCLR.cs
- ToolTipAutomationPeer.cs
- LabelEditEvent.cs
- IncrementalReadDecoders.cs
- EntryPointNotFoundException.cs
- StatusBar.cs
- ConfigurationLockCollection.cs
- LinqDataSourceDeleteEventArgs.cs
- InvalidCommandTreeException.cs
- HttpCacheParams.cs