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
- Rule.cs
- WebPartDeleteVerb.cs
- SqlMethods.cs
- WindowsListViewGroup.cs
- TreeViewCancelEvent.cs
- MeasurementDCInfo.cs
- FontFaceLayoutInfo.cs
- SearchForVirtualItemEventArgs.cs
- FontStretches.cs
- bidPrivateBase.cs
- EncodingFallbackAwareXmlTextWriter.cs
- MetaModel.cs
- AutomationPatternInfo.cs
- RectAnimationBase.cs
- ExtendedPropertyCollection.cs
- EventQueueState.cs
- XhtmlTextWriter.cs
- HttpCapabilitiesEvaluator.cs
- WebHeaderCollection.cs
- PrimaryKeyTypeConverter.cs
- Task.cs
- MessageQueueTransaction.cs
- DataRowChangeEvent.cs
- HttpModulesSection.cs
- GraphicsPathIterator.cs
- ValidationResults.cs
- ProgressBar.cs
- SqlFormatter.cs
- PerfCounters.cs
- Stack.cs
- IItemContainerGenerator.cs
- ObjectConverter.cs
- RsaSecurityTokenAuthenticator.cs
- NCryptNative.cs
- WebPartDescriptionCollection.cs
- RuntimeWrappedException.cs
- ImagingCache.cs
- EntityFrameworkVersions.cs
- ActivityExecutionFilter.cs
- UniqueIdentifierService.cs
- ReflectionUtil.cs
- EventsTab.cs
- ComplexObject.cs
- QueryResponse.cs
- SiteMapDataSourceView.cs
- ConnectorRouter.cs
- WebPartZoneBase.cs
- AccessedThroughPropertyAttribute.cs
- OleDbReferenceCollection.cs
- AddInSegmentDirectoryNotFoundException.cs
- Transform3DCollection.cs
- CssStyleCollection.cs
- QilInvokeEarlyBound.cs
- PrePrepareMethodAttribute.cs
- RuntimeConfig.cs
- SHA1.cs
- EventLogEntry.cs
- ContextProperty.cs
- ToggleProviderWrapper.cs
- MsmqHostedTransportManager.cs
- HyperLinkColumn.cs
- ClickablePoint.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- DesignerGenericWebPart.cs
- SamlDelegatingWriter.cs
- ButtonBase.cs
- LazyTextWriterCreator.cs
- Message.cs
- DesignerSerializationManager.cs
- TempEnvironment.cs
- ColorPalette.cs
- SerializationException.cs
- AsymmetricKeyExchangeDeformatter.cs
- FloatAverageAggregationOperator.cs
- GridItemProviderWrapper.cs
- TextElementEditingBehaviorAttribute.cs
- NumericExpr.cs
- PersonalizableAttribute.cs
- RtfToken.cs
- TextTreeInsertUndoUnit.cs
- CallbackCorrelationInitializer.cs
- MatcherBuilder.cs
- XmlTextWriter.cs
- ToolTipService.cs
- RegionInfo.cs
- XmlSchemaSimpleTypeUnion.cs
- ArgumentException.cs
- XsdCachingReader.cs
- SimpleWebHandlerParser.cs
- DoubleCollection.cs
- ControlBuilder.cs
- WebBrowserNavigatedEventHandler.cs
- SortedList.cs
- PropertyGridEditorPart.cs
- MsmqReceiveParameters.cs
- BidOverLoads.cs
- NopReturnReader.cs
- NavigationProperty.cs
- MissingMemberException.cs
- TimeStampChecker.cs