Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / ImmutableObjectAttribute.cs / 1305376 / ImmutableObjectAttribute.cs
namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// Specifies that a object has no sub properties that are editable. /// [AttributeUsage(AttributeTargets.All)] public sealed class ImmutableObjectAttribute : Attribute { ////// Specifies that a object has no sub properties that are editable. /// /// This is usually used in the properties window to determine if an expandable object /// should be rendered as read-only. /// public static readonly ImmutableObjectAttribute Yes = new ImmutableObjectAttribute(true); ////// Specifies that a object has at least one editable sub-property. /// /// This is usually used in the properties window to determine if an expandable object /// should be rendered as read-only. /// public static readonly ImmutableObjectAttribute No = new ImmutableObjectAttribute(false); ////// Defaults to ImmutableObjectAttribute.No /// public static readonly ImmutableObjectAttribute Default = No; private bool immutable = true; ////// Constructs an ImmutableObjectAttribute object. /// /// public ImmutableObjectAttribute(bool immutable) { this.immutable = immutable; } ////// public bool Immutable { get { return immutable; } } ///[To be supplied.] ////// /// public override bool Equals(object obj) { if (obj == this) { return true; } ImmutableObjectAttribute other = obj as ImmutableObjectAttribute; return other != null && other.Immutable == this.immutable; } ////// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// /// public override bool IsDefaultAttribute() { return (this.Equals(Default)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; ////// Specifies that a object has no sub properties that are editable. /// [AttributeUsage(AttributeTargets.All)] public sealed class ImmutableObjectAttribute : Attribute { ////// Specifies that a object has no sub properties that are editable. /// /// This is usually used in the properties window to determine if an expandable object /// should be rendered as read-only. /// public static readonly ImmutableObjectAttribute Yes = new ImmutableObjectAttribute(true); ////// Specifies that a object has at least one editable sub-property. /// /// This is usually used in the properties window to determine if an expandable object /// should be rendered as read-only. /// public static readonly ImmutableObjectAttribute No = new ImmutableObjectAttribute(false); ////// Defaults to ImmutableObjectAttribute.No /// public static readonly ImmutableObjectAttribute Default = No; private bool immutable = true; ////// Constructs an ImmutableObjectAttribute object. /// /// public ImmutableObjectAttribute(bool immutable) { this.immutable = immutable; } ////// public bool Immutable { get { return immutable; } } ///[To be supplied.] ////// /// public override bool Equals(object obj) { if (obj == this) { return true; } ImmutableObjectAttribute other = obj as ImmutableObjectAttribute; return other != null && other.Immutable == this.immutable; } ////// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// /// public override bool IsDefaultAttribute() { return (this.Equals(Default)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BridgeDataReader.cs
- XsltSettings.cs
- EventTrigger.cs
- SystemSounds.cs
- FrameworkContentElementAutomationPeer.cs
- StubHelpers.cs
- TypeConverterAttribute.cs
- FieldBuilder.cs
- CreateUserWizard.cs
- StringUtil.cs
- HostedAspNetEnvironment.cs
- UserControl.cs
- KeysConverter.cs
- ClientData.cs
- CodeComment.cs
- HashCryptoHandle.cs
- URLAttribute.cs
- SingleAnimation.cs
- ScrollBarRenderer.cs
- Util.cs
- DeferrableContentConverter.cs
- WebConfigurationHostFileChange.cs
- TrackingAnnotationCollection.cs
- FormViewActionList.cs
- ManipulationPivot.cs
- DataGridAutoFormat.cs
- SizeKeyFrameCollection.cs
- SmiMetaDataProperty.cs
- ImageAnimator.cs
- TextTrailingWordEllipsis.cs
- ViewLoader.cs
- MatrixTransform3D.cs
- Literal.cs
- _ContextAwareResult.cs
- SqlBuilder.cs
- UnhandledExceptionEventArgs.cs
- RSAOAEPKeyExchangeFormatter.cs
- GridViewSelectEventArgs.cs
- OdbcConnectionFactory.cs
- X509ThumbprintKeyIdentifierClause.cs
- XmlWellformedWriter.cs
- ListControl.cs
- ObjectDataSourceStatusEventArgs.cs
- SqlDataSourceCache.cs
- ExpressionBuilderContext.cs
- TextServicesCompartmentEventSink.cs
- DataReceivedEventArgs.cs
- ForeignKeyConstraint.cs
- DataGridColumnDropSeparator.cs
- PopupRoot.cs
- MenuItemBindingCollection.cs
- StringValidatorAttribute.cs
- OracleParameterCollection.cs
- PostBackOptions.cs
- UntypedNullExpression.cs
- ServerValidateEventArgs.cs
- FixedSOMPage.cs
- TailCallAnalyzer.cs
- RNGCryptoServiceProvider.cs
- ComponentEvent.cs
- CompletedAsyncResult.cs
- XPathArrayIterator.cs
- ContextMenuAutomationPeer.cs
- BindableTemplateBuilder.cs
- RichTextBoxAutomationPeer.cs
- ControlBuilder.cs
- PropertyRef.cs
- ping.cs
- ConfigXmlText.cs
- WebPartHeaderCloseVerb.cs
- ImportContext.cs
- SplitContainerDesigner.cs
- FrameworkElement.cs
- DbParameterHelper.cs
- ProcessingInstructionAction.cs
- DbUpdateCommandTree.cs
- XmlRawWriter.cs
- AccessDataSourceDesigner.cs
- BinHexDecoder.cs
- StringExpressionSet.cs
- TextParagraphView.cs
- SendMailErrorEventArgs.cs
- ExeConfigurationFileMap.cs
- PackageStore.cs
- ToolStripPanelDesigner.cs
- ExtensionSimplifierMarkupObject.cs
- BooleanStorage.cs
- BuildProviderUtils.cs
- EndpointDiscoveryBehavior.cs
- BinaryConverter.cs
- ExecutionContext.cs
- AppliedDeviceFiltersEditor.cs
- WarningException.cs
- InputLangChangeEvent.cs
- SecurityTokenProvider.cs
- TransactionalPackage.cs
- DockPatternIdentifiers.cs
- UserNameSecurityTokenProvider.cs
- ComAwareEventInfo.cs
- Button.cs