Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / ImmutableObjectAttribute.cs / 1 / 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
- ResourceManager.cs
- StorageFunctionMapping.cs
- TrustManager.cs
- EdmValidator.cs
- StandardToolWindows.cs
- StorageMappingItemLoader.cs
- CollectionTraceRecord.cs
- TargetPerspective.cs
- Environment.cs
- ColorInterpolationModeValidation.cs
- XslCompiledTransform.cs
- UrlAuthFailedErrorFormatter.cs
- ServiceInfo.cs
- WebProxyScriptElement.cs
- RadioButton.cs
- InternalCache.cs
- MultiPartWriter.cs
- XmlMembersMapping.cs
- ConfigXmlWhitespace.cs
- ITreeGenerator.cs
- VectorAnimationBase.cs
- BamlBinaryWriter.cs
- Schema.cs
- ToolStripItemEventArgs.cs
- DateTimeUtil.cs
- BasicHttpBindingElement.cs
- ApplicationContext.cs
- TemplatedAdorner.cs
- BaseTemplateBuildProvider.cs
- SQlBooleanStorage.cs
- AppDomainProtocolHandler.cs
- Bidi.cs
- HttpHandlerActionCollection.cs
- MouseEventArgs.cs
- BitmapFrameDecode.cs
- TableLayoutStyle.cs
- SHA256Cng.cs
- StoreAnnotationsMap.cs
- QueryCacheManager.cs
- BaseProcessor.cs
- DataGridViewRowsAddedEventArgs.cs
- ProxyElement.cs
- SpoolingTaskBase.cs
- Command.cs
- ImageClickEventArgs.cs
- RegexBoyerMoore.cs
- SessionState.cs
- EntityViewGenerationConstants.cs
- SynchronizationContext.cs
- BitmapEffectCollection.cs
- PointUtil.cs
- CodeDirectionExpression.cs
- OpenTypeLayoutCache.cs
- DataPagerField.cs
- TypeGeneratedEventArgs.cs
- CodeSnippetExpression.cs
- LinkLabelLinkClickedEvent.cs
- DocComment.cs
- CacheVirtualItemsEvent.cs
- IFormattable.cs
- AccessDataSourceView.cs
- DrawingContext.cs
- Adorner.cs
- XPathParser.cs
- ThreadStaticAttribute.cs
- AssemblyAttributesGoHere.cs
- HitTestParameters3D.cs
- GlyphRunDrawing.cs
- LocatorPartList.cs
- DeadCharTextComposition.cs
- _ConnectStream.cs
- FormViewPagerRow.cs
- SqlTopReducer.cs
- SQLInt16Storage.cs
- HttpProfileBase.cs
- EnvironmentPermission.cs
- CompositeActivityCodeGenerator.cs
- LockedBorderGlyph.cs
- SiblingIterators.cs
- ComplusTypeValidator.cs
- MessageSecurityTokenVersion.cs
- PasswordBoxAutomationPeer.cs
- ProcessStartInfo.cs
- AuthenticationServiceManager.cs
- Perspective.cs
- SourceItem.cs
- ReadOnlyNameValueCollection.cs
- MissingManifestResourceException.cs
- AsyncPostBackErrorEventArgs.cs
- sqlcontext.cs
- TextViewBase.cs
- Geometry3D.cs
- ButtonFieldBase.cs
- Version.cs
- WebContext.cs
- SafeRightsManagementQueryHandle.cs
- WebPartZoneBase.cs
- SaveFileDialog.cs
- SessionStateSection.cs
- ToolBarButton.cs