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
- XmlQualifiedName.cs
- GPRECT.cs
- Command.cs
- OleDbDataAdapter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- FreezableDefaultValueFactory.cs
- ResXDataNode.cs
- Bits.cs
- StringToken.cs
- Int32.cs
- Bits.cs
- Privilege.cs
- UriScheme.cs
- ComponentDispatcherThread.cs
- WsatConfiguration.cs
- RootContext.cs
- WebPartMenu.cs
- CommonProperties.cs
- DesignerOptions.cs
- ExceptionHandlers.cs
- PropagatorResult.cs
- DecimalConverter.cs
- EventData.cs
- GridViewItemAutomationPeer.cs
- ExceptionHelpers.cs
- httpserverutility.cs
- DeviceContext.cs
- ObjectDataSourceMethodEventArgs.cs
- RangeBase.cs
- SmtpDigestAuthenticationModule.cs
- XPathNodeHelper.cs
- CodeTypeParameterCollection.cs
- ControlsConfig.cs
- CommunicationObject.cs
- CodeIdentifier.cs
- CheckBoxRenderer.cs
- RedBlackList.cs
- IISMapPath.cs
- ChannelListenerBase.cs
- XmlDomTextWriter.cs
- FontDialog.cs
- SafeTimerHandle.cs
- Effect.cs
- HandledEventArgs.cs
- EdmType.cs
- UserInitiatedRoutedEventPermission.cs
- EventsTab.cs
- SessionParameter.cs
- RemotingClientProxy.cs
- ComPlusTraceRecord.cs
- OdbcConnectionStringbuilder.cs
- login.cs
- ZipIORawDataFileBlock.cs
- ModelItemDictionaryImpl.cs
- StylusPointDescription.cs
- TraceData.cs
- XmlComment.cs
- PreservationFileWriter.cs
- Compress.cs
- DateTimeConverter2.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- OneOfElement.cs
- CompiledIdentityConstraint.cs
- DbProviderManifest.cs
- MetadataArtifactLoaderResource.cs
- PostBackOptions.cs
- ControlCachePolicy.cs
- InternalConfigRoot.cs
- Sequence.cs
- ExpandoObject.cs
- BidirectionalDictionary.cs
- Floater.cs
- _OSSOCK.cs
- sqlstateclientmanager.cs
- TextEditorTyping.cs
- XmlNodeReader.cs
- JsonFormatReaderGenerator.cs
- AnnotationComponentManager.cs
- StyleXamlParser.cs
- BmpBitmapEncoder.cs
- GiveFeedbackEvent.cs
- TreeNodeStyleCollection.cs
- Floater.cs
- Int32Animation.cs
- HandleExceptionArgs.cs
- XslTransform.cs
- ImageSourceValueSerializer.cs
- CodeGeneratorOptions.cs
- PathSegment.cs
- ComponentRenameEvent.cs
- ByteStream.cs
- PeerNameRecord.cs
- TogglePatternIdentifiers.cs
- SharedPerformanceCounter.cs
- WsiProfilesElement.cs
- ContentValidator.cs
- RijndaelManagedTransform.cs
- LinqMaximalSubtreeNominator.cs
- CookieParameter.cs
- FixedTextSelectionProcessor.cs