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
- VectorAnimationBase.cs
- Matrix.cs
- XmlSchemaSimpleTypeList.cs
- SqlDataSourceConfigureSelectPanel.cs
- GB18030Encoding.cs
- XPathNavigatorKeyComparer.cs
- EnumUnknown.cs
- GroupStyle.cs
- WebResponse.cs
- Point3DAnimationBase.cs
- SelectorAutomationPeer.cs
- Range.cs
- PackageRelationship.cs
- SqlProviderServices.cs
- DesignerActionItem.cs
- SynchronizationContext.cs
- TheQuery.cs
- FileDialog.cs
- StatusBarItemAutomationPeer.cs
- ProfileInfo.cs
- GZipDecoder.cs
- Margins.cs
- TypeToStringValueConverter.cs
- ErrorInfoXmlDocument.cs
- Visual3D.cs
- SelectionProcessor.cs
- SoapProtocolReflector.cs
- WebPartHelpVerb.cs
- StylusButtonEventArgs.cs
- RegistryPermission.cs
- ViewStateModeByIdAttribute.cs
- AlgoModule.cs
- UnsafeNativeMethodsTablet.cs
- EventlogProvider.cs
- Condition.cs
- RemoteCryptoTokenProvider.cs
- ExpressionBuilderContext.cs
- CommonObjectSecurity.cs
- SchemaLookupTable.cs
- VersionPair.cs
- XamlSerializerUtil.cs
- MtomMessageEncodingBindingElement.cs
- BackEase.cs
- ObjectListCommandEventArgs.cs
- ProtocolsConfigurationEntry.cs
- RawStylusInputCustomData.cs
- TabControlEvent.cs
- TransactionsSectionGroup.cs
- ProxyWebPartManager.cs
- EncodingNLS.cs
- ApplicationFileParser.cs
- SmtpNtlmAuthenticationModule.cs
- ListControlDesigner.cs
- TableRowGroup.cs
- HwndSource.cs
- DataRowCollection.cs
- TextBoxAutomationPeer.cs
- BrowserDefinitionCollection.cs
- UnsafeNativeMethods.cs
- CommandID.cs
- PerfCounters.cs
- SafeMarshalContext.cs
- unitconverter.cs
- CodeNamespaceImport.cs
- EmissiveMaterial.cs
- ObjectListDesigner.cs
- ConfigsHelper.cs
- GenericEnumerator.cs
- ScrollChrome.cs
- assertwrapper.cs
- ExpandSegmentCollection.cs
- TransformPatternIdentifiers.cs
- PathSegmentCollection.cs
- PersonalizationStateInfo.cs
- LongPath.cs
- ExpressionsCollectionEditor.cs
- EventLogSession.cs
- DataGridItem.cs
- HtmlToClrEventProxy.cs
- XmlSchemaObjectTable.cs
- Trigger.cs
- DataException.cs
- TaskFormBase.cs
- EventProxy.cs
- DesignerCapabilities.cs
- SynchronizedInputPattern.cs
- Journaling.cs
- _AutoWebProxyScriptHelper.cs
- Timer.cs
- _SafeNetHandles.cs
- CompoundFileReference.cs
- EntityDataSourceReferenceGroup.cs
- ServiceModelActivationSectionGroup.cs
- Parallel.cs
- MouseEvent.cs
- DataGridCommandEventArgs.cs
- BaseCollection.cs
- DataGridViewToolTip.cs
- MailAddressCollection.cs
- BooleanFunctions.cs