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
- CacheSection.cs
- Brush.cs
- CommandLibraryHelper.cs
- OperationExecutionFault.cs
- SoapParser.cs
- TransformProviderWrapper.cs
- DrawTreeNodeEventArgs.cs
- SoundPlayer.cs
- OleDbConnectionInternal.cs
- CommentEmitter.cs
- ProcessHostMapPath.cs
- DrawListViewColumnHeaderEventArgs.cs
- ReferencedType.cs
- BamlBinaryReader.cs
- WebZone.cs
- InternalTypeHelper.cs
- SqlOuterApplyReducer.cs
- LayoutSettings.cs
- BindValidationContext.cs
- Block.cs
- Baml2006ReaderContext.cs
- CornerRadius.cs
- ISessionStateStore.cs
- PersonalizationStateInfoCollection.cs
- PublishLicense.cs
- BitmapEffectRenderDataResource.cs
- NullReferenceException.cs
- ContainerAction.cs
- RelationHandler.cs
- FeatureManager.cs
- EventlogProvider.cs
- DispatcherTimer.cs
- BuildProviderAppliesToAttribute.cs
- TreeIterator.cs
- BinaryObjectInfo.cs
- COAUTHIDENTITY.cs
- TextPenaltyModule.cs
- PropertyPushdownHelper.cs
- IndexedGlyphRun.cs
- SmtpException.cs
- StyleBamlRecordReader.cs
- Select.cs
- OpenFileDialog.cs
- BeginStoryboard.cs
- TextBlockAutomationPeer.cs
- ValueChangedEventManager.cs
- _IPv6Address.cs
- LayoutTable.cs
- Flowchart.cs
- View.cs
- CapiHashAlgorithm.cs
- XmlAtomErrorReader.cs
- SmtpTransport.cs
- HighContrastHelper.cs
- DSASignatureDeformatter.cs
- StringCollectionEditor.cs
- TableParagraph.cs
- PolyBezierSegment.cs
- StateBag.cs
- InputQueue.cs
- ValueOfAction.cs
- DBCSCodePageEncoding.cs
- ApplicationServiceHelper.cs
- ParameterBinding.cs
- BufferedStream.cs
- XmlQueryRuntime.cs
- GlyphRun.cs
- AffineTransform3D.cs
- UrlMapping.cs
- SocketPermission.cs
- SelectedDatesCollection.cs
- FlagsAttribute.cs
- HybridDictionary.cs
- OleDbStruct.cs
- DataColumnChangeEvent.cs
- PropertyGrid.cs
- Selection.cs
- SmiRecordBuffer.cs
- OperationCanceledException.cs
- baseaxisquery.cs
- AnnotationComponentChooser.cs
- SignatureToken.cs
- DataFormats.cs
- UInt32Converter.cs
- ListChangedEventArgs.cs
- Rfc2898DeriveBytes.cs
- InteropExecutor.cs
- DeleteMemberBinder.cs
- _TimerThread.cs
- NameValueSectionHandler.cs
- OracleRowUpdatingEventArgs.cs
- Int32CAMarshaler.cs
- WorkingDirectoryEditor.cs
- WebPartConnectionCollection.cs
- PersonalizationStateQuery.cs
- ProfileSettings.cs
- RegistrySecurity.cs
- HttpApplicationFactory.cs
- ContractMapping.cs
- ServiceOperationListItemList.cs