Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / ReadOnlyAttribute.cs / 1 / 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
- XsdDataContractExporter.cs
- InheritedPropertyChangedEventArgs.cs
- OracleTimeSpan.cs
- Trace.cs
- SiteMap.cs
- ContentControl.cs
- HttpPostedFile.cs
- Int64AnimationBase.cs
- QueryCursorEventArgs.cs
- AddDataControlFieldDialog.cs
- SqlDataSourceSelectingEventArgs.cs
- DBNull.cs
- TrustDriver.cs
- NamespaceDecl.cs
- ApplicationFileParser.cs
- EditingCommands.cs
- Dictionary.cs
- XPathAxisIterator.cs
- CompareValidator.cs
- ToolStripItemCollection.cs
- Persist.cs
- RepeatInfo.cs
- WebPartMenuStyle.cs
- XmlJsonWriter.cs
- TransformConverter.cs
- MimeMapping.cs
- SchemaMapping.cs
- DocumentViewerHelper.cs
- Brush.cs
- QueryCacheEntry.cs
- HwndSourceParameters.cs
- PixelFormat.cs
- CheckBoxRenderer.cs
- DBCommandBuilder.cs
- DeleteCardRequest.cs
- GcHandle.cs
- TaskFormBase.cs
- TimeSpanStorage.cs
- DataGridViewRow.cs
- Point3DKeyFrameCollection.cs
- ObjectConverter.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TriggerActionCollection.cs
- ResourceManagerWrapper.cs
- ConditionCollection.cs
- WebControlParameterProxy.cs
- ServerValidateEventArgs.cs
- WmpBitmapEncoder.cs
- AutoResetEvent.cs
- SelectedGridItemChangedEvent.cs
- DynamicDataRoute.cs
- CatalogPartChrome.cs
- ReferencedType.cs
- ContentElement.cs
- Int32RectConverter.cs
- WindowsBrush.cs
- TraceHwndHost.cs
- TextParagraph.cs
- ResXResourceSet.cs
- RuleRef.cs
- ObjectViewListener.cs
- PatternMatcher.cs
- Atom10FormatterFactory.cs
- EventDescriptor.cs
- QueryOperationResponseOfT.cs
- NullReferenceException.cs
- QilParameter.cs
- FileAuthorizationModule.cs
- XmlSchemaSimpleContentRestriction.cs
- RenderDataDrawingContext.cs
- TreeView.cs
- XmlSchemaAttributeGroup.cs
- CopyAttributesAction.cs
- TransformGroup.cs
- XPathScanner.cs
- ColorBlend.cs
- dataprotectionpermission.cs
- TimeSpan.cs
- SelectionChangedEventArgs.cs
- DateBoldEvent.cs
- SoapHeaders.cs
- WindowsSysHeader.cs
- WebPartZoneAutoFormat.cs
- XmlDocument.cs
- AsyncOperationManager.cs
- CacheDict.cs
- ToolStripOverflowButton.cs
- coordinator.cs
- KeyValuePairs.cs
- odbcmetadatafactory.cs
- Int32RectValueSerializer.cs
- DragEvent.cs
- HttpRawResponse.cs
- PTProvider.cs
- mediaeventargs.cs
- CultureMapper.cs
- StringSource.cs
- VectorCollectionConverter.cs
- TargetControlTypeCache.cs
- EntityPropertyMappingAttribute.cs