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
- TimeSpanMinutesConverter.cs
- WindowsFormsHostPropertyMap.cs
- tibetanshape.cs
- XmlComplianceUtil.cs
- PasswordDeriveBytes.cs
- StylusPointPropertyInfoDefaults.cs
- IndependentAnimationStorage.cs
- ExcCanonicalXml.cs
- SocketPermission.cs
- AssemblyBuilder.cs
- XmlILConstructAnalyzer.cs
- SettingsBindableAttribute.cs
- HttpHandlerActionCollection.cs
- SoundPlayerAction.cs
- SequenceRangeCollection.cs
- InvalidWMPVersionException.cs
- XmlNodeChangedEventArgs.cs
- Point3DCollection.cs
- ConnectivityStatus.cs
- Model3DGroup.cs
- ScrollEventArgs.cs
- DescendantQuery.cs
- BindingList.cs
- CodeDelegateCreateExpression.cs
- DataRowChangeEvent.cs
- TextDecorationCollectionConverter.cs
- Internal.cs
- DataGridViewCellFormattingEventArgs.cs
- MachineKeySection.cs
- PerformanceCounterManager.cs
- UIInitializationException.cs
- EntitySetDataBindingList.cs
- TabControl.cs
- StaticSiteMapProvider.cs
- AccessDataSourceView.cs
- DataServiceKeyAttribute.cs
- ParseNumbers.cs
- designeractionlistschangedeventargs.cs
- DictionaryBase.cs
- SqlUtil.cs
- MasterPage.cs
- TextContainerChangedEventArgs.cs
- ProviderCollection.cs
- StickyNote.cs
- ControlParameter.cs
- _DomainName.cs
- Compensation.cs
- ProxyManager.cs
- recordstate.cs
- JumpPath.cs
- TransformerInfoCollection.cs
- ClientFormsIdentity.cs
- RowToParametersTransformer.cs
- PtsHost.cs
- ServiceModelSecurityTokenRequirement.cs
- InternalCache.cs
- StoragePropertyMapping.cs
- TitleStyle.cs
- coordinator.cs
- UdpSocketReceiveManager.cs
- GridViewCommandEventArgs.cs
- DataServiceException.cs
- ErrorHandler.cs
- EditorPartChrome.cs
- EFTableProvider.cs
- Propagator.JoinPropagator.cs
- ItemCollection.cs
- METAHEADER.cs
- VoiceObjectToken.cs
- XPathNodeHelper.cs
- SecurityRuntime.cs
- SystemResources.cs
- LoginName.cs
- SchemaCollectionCompiler.cs
- TransformerInfoCollection.cs
- _DigestClient.cs
- MessageAction.cs
- SendContent.cs
- QueryExtender.cs
- InternalException.cs
- PrintPreviewGraphics.cs
- URI.cs
- ThicknessAnimationBase.cs
- RectangleConverter.cs
- XmlSchemaObjectTable.cs
- ListBoxItem.cs
- HtmlCommandAdapter.cs
- WebPartConnectionsCloseVerb.cs
- EditorServiceContext.cs
- ConditionChanges.cs
- RequestCacheEntry.cs
- TreeNodeCollection.cs
- EdmProperty.cs
- TreePrinter.cs
- StreamGeometry.cs
- DecoderReplacementFallback.cs
- ReferenceTypeElement.cs
- DataRelationCollection.cs
- LabelLiteral.cs
- DataKeyArray.cs