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
- DocumentViewerAutomationPeer.cs
- Identifier.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Visual3D.cs
- SqlTriggerAttribute.cs
- LinqDataSourceEditData.cs
- Directory.cs
- AutomationProperty.cs
- QueryRewriter.cs
- XsdDataContractImporter.cs
- ServiceNameElementCollection.cs
- LockCookie.cs
- WebPartsPersonalizationAuthorization.cs
- TranslateTransform.cs
- X509InitiatorCertificateServiceElement.cs
- LinkedResourceCollection.cs
- FontInfo.cs
- SrgsDocument.cs
- MarkerProperties.cs
- FileStream.cs
- XmlHierarchyData.cs
- ToolStripItemEventArgs.cs
- DataView.cs
- PassportPrincipal.cs
- ArrayList.cs
- WebMessageBodyStyleHelper.cs
- AttachmentCollection.cs
- AnonymousIdentificationSection.cs
- TextTrailingCharacterEllipsis.cs
- FixedDocumentSequencePaginator.cs
- SiteMapDataSource.cs
- ExtensionFile.cs
- LocalTransaction.cs
- X509UI.cs
- _BasicClient.cs
- _SecureChannel.cs
- Nodes.cs
- FormViewDeletedEventArgs.cs
- returneventsaver.cs
- ReturnValue.cs
- EntityDataSourceChangedEventArgs.cs
- CannotUnloadAppDomainException.cs
- Win32.cs
- TransformConverter.cs
- ValidatorCollection.cs
- SimpleBitVector32.cs
- CallbackHandler.cs
- SqlWriter.cs
- PropertyNames.cs
- DynamicPhysicalDiscoSearcher.cs
- BoundConstants.cs
- DetailsViewPagerRow.cs
- DbDataAdapter.cs
- EntitySetBase.cs
- WindowsListViewItemCheckBox.cs
- X509UI.cs
- DelayDesigner.cs
- TrackingRecord.cs
- IntSecurity.cs
- MergeFailedEvent.cs
- SamlAttributeStatement.cs
- XsltLibrary.cs
- ExpressionHelper.cs
- XPathDocumentBuilder.cs
- QuarticEase.cs
- EventRouteFactory.cs
- Listbox.cs
- Globals.cs
- DCSafeHandle.cs
- ButtonPopupAdapter.cs
- IgnoreFileBuildProvider.cs
- InvalidEnumArgumentException.cs
- UrlMapping.cs
- QueryReaderSettings.cs
- ColorTransform.cs
- DataListItem.cs
- BitmapImage.cs
- FixedSOMContainer.cs
- xml.cs
- DataServiceKeyAttribute.cs
- ProxyWebPart.cs
- Rotation3D.cs
- CustomError.cs
- SerializationException.cs
- SqlFlattener.cs
- DataGridViewRowHeaderCell.cs
- ChildChangedEventArgs.cs
- PointAnimationBase.cs
- DatagramAdapter.cs
- SelectionProcessor.cs
- RootBrowserWindowAutomationPeer.cs
- IisTraceWebEventProvider.cs
- ListItemConverter.cs
- NavigateEvent.cs
- StylusPointPropertyUnit.cs
- DiagnosticsConfigurationHandler.cs
- StrongName.cs
- _emptywebproxy.cs
- GroupBox.cs
- SqlPersonalizationProvider.cs