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
- FunctionDetailsReader.cs
- sqlmetadatafactory.cs
- DataRowComparer.cs
- CustomSignedXml.cs
- PasswordPropertyTextAttribute.cs
- DefaultMemberAttribute.cs
- HWStack.cs
- PerfCounters.cs
- CriticalFinalizerObject.cs
- TypeUtils.cs
- XmlSerializerAssemblyAttribute.cs
- TemplateXamlTreeBuilder.cs
- GetWinFXPath.cs
- TextRange.cs
- ServiceNameElementCollection.cs
- ServiceEndpointCollection.cs
- AuthenticatedStream.cs
- SafeNativeMethods.cs
- XmlSchemaSimpleContentExtension.cs
- StringFreezingAttribute.cs
- ValidatorCollection.cs
- ScriptResourceHandler.cs
- MonthChangedEventArgs.cs
- Slider.cs
- DiagnosticTraceSchemas.cs
- LiteralTextContainerControlBuilder.cs
- PopOutPanel.cs
- StructuralType.cs
- RegisteredArrayDeclaration.cs
- OleDbRowUpdatedEvent.cs
- HighContrastHelper.cs
- IgnoreFlushAndCloseStream.cs
- ProjectionPlan.cs
- WorkerRequest.cs
- LoadedOrUnloadedOperation.cs
- EventDescriptor.cs
- ResXBuildProvider.cs
- RequestCachePolicy.cs
- ModelChangedEventArgsImpl.cs
- SymbolMethod.cs
- CancellationHandler.cs
- XmlIgnoreAttribute.cs
- BitSet.cs
- BitmapEffectInputData.cs
- CompilerGeneratedAttribute.cs
- WizardPanelChangingEventArgs.cs
- EdmItemError.cs
- WebCategoryAttribute.cs
- X509ChainPolicy.cs
- DataFormat.cs
- AccessedThroughPropertyAttribute.cs
- TaskFormBase.cs
- Socket.cs
- AssemblyCollection.cs
- CaseInsensitiveComparer.cs
- SafeHandles.cs
- MenuItemCollection.cs
- CqlLexer.cs
- UserControlAutomationPeer.cs
- FontStretch.cs
- PKCS1MaskGenerationMethod.cs
- Facet.cs
- SystemInformation.cs
- ResourceContainer.cs
- DataStreams.cs
- WorkflowOperationBehavior.cs
- ErrorTableItemStyle.cs
- TableRow.cs
- DataObjectSettingDataEventArgs.cs
- WorkflowCommandExtensionItem.cs
- BaseConfigurationRecord.cs
- SineEase.cs
- InvalidPrinterException.cs
- fixedPageContentExtractor.cs
- ShapeTypeface.cs
- OracleCommand.cs
- SqlBooleanMismatchVisitor.cs
- DrawListViewSubItemEventArgs.cs
- AttributeAction.cs
- NamespaceInfo.cs
- MsmqReceiveParameters.cs
- RectangleHotSpot.cs
- ConfigXmlElement.cs
- TextRangeAdaptor.cs
- WebRequestModuleElementCollection.cs
- SymmetricSecurityProtocolFactory.cs
- __ComObject.cs
- AssociationSetMetadata.cs
- CopyNodeSetAction.cs
- AlphaSortedEnumConverter.cs
- ExpandSegment.cs
- ParallelTimeline.cs
- COM2FontConverter.cs
- SiteMapNodeItem.cs
- IconBitmapDecoder.cs
- DataFormats.cs
- WebPartConnectionsCloseVerb.cs
- TextWriterTraceListener.cs
- DataGridViewRow.cs
- Point3DIndependentAnimationStorage.cs