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
- CopyOnWriteList.cs
- NonceToken.cs
- XsltSettings.cs
- CompressEmulationStream.cs
- CellNormalizer.cs
- EmptyReadOnlyDictionaryInternal.cs
- WorkflowServiceInstance.cs
- DriveInfo.cs
- VirtualDirectoryMapping.cs
- CodeMemberMethod.cs
- DebugView.cs
- Gdiplus.cs
- Span.cs
- HttpModuleActionCollection.cs
- MediaScriptCommandRoutedEventArgs.cs
- ReferenceSchema.cs
- IdentitySection.cs
- DataMemberAttribute.cs
- webproxy.cs
- _ShellExpression.cs
- InteropTrackingRecord.cs
- MimePart.cs
- ModelVisual3D.cs
- CommandID.cs
- DispatcherExceptionEventArgs.cs
- Compilation.cs
- Literal.cs
- CancellationHandlerDesigner.cs
- TextElement.cs
- EraserBehavior.cs
- DefaultValidator.cs
- HWStack.cs
- ScriptManager.cs
- GeneralTransform.cs
- ApplicationId.cs
- AssemblyResourceLoader.cs
- SystemTcpConnection.cs
- XmlNamespaceMappingCollection.cs
- TreeViewHitTestInfo.cs
- StylusPointProperty.cs
- CodePageUtils.cs
- DependencyObjectPropertyDescriptor.cs
- CultureTableRecord.cs
- KerberosSecurityTokenAuthenticator.cs
- RelativeSource.cs
- GridViewColumn.cs
- MouseButtonEventArgs.cs
- CodeTypeReferenceExpression.cs
- TaskExtensions.cs
- TableRow.cs
- Transform3D.cs
- DeferrableContentConverter.cs
- Geometry.cs
- Point.cs
- JournalEntryStack.cs
- CacheSection.cs
- DragDeltaEventArgs.cs
- XsdBuilder.cs
- RSAPKCS1SignatureFormatter.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- DataGridViewSelectedCellCollection.cs
- PackUriHelper.cs
- KeyboardDevice.cs
- ListDictionary.cs
- FormViewUpdateEventArgs.cs
- HttpCookie.cs
- PortCache.cs
- DataSourceControlBuilder.cs
- SelectionProviderWrapper.cs
- TextEditorSpelling.cs
- SqlUDTStorage.cs
- EntityModelBuildProvider.cs
- SoapElementAttribute.cs
- PersistenceContextEnlistment.cs
- StagingAreaInputItem.cs
- SecurityUtils.cs
- SystemIPv6InterfaceProperties.cs
- XmlElementAttribute.cs
- UIPermission.cs
- NestPullup.cs
- ReflectPropertyDescriptor.cs
- LocalServiceSecuritySettingsElement.cs
- FileSystemWatcher.cs
- ScrollChangedEventArgs.cs
- X509CertificateChain.cs
- NullableConverter.cs
- CustomWebEventKey.cs
- DbReferenceCollection.cs
- MobileUserControl.cs
- TextureBrush.cs
- OleDbCommand.cs
- ContextMenu.cs
- DataGridViewRowCollection.cs
- RedistVersionInfo.cs
- DataGridViewRowsRemovedEventArgs.cs
- RenderData.cs
- SequentialActivityDesigner.cs
- ProfileManager.cs
- SafeNativeMethods.cs
- PropertyConverter.cs