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
- SafeCertificateContext.cs
- __Filters.cs
- ListItemsPage.cs
- ScriptMethodAttribute.cs
- SafeProcessHandle.cs
- ExpressionBuilder.cs
- TrackingLocationCollection.cs
- TreeViewBindingsEditorForm.cs
- MbpInfo.cs
- CompileLiteralTextParser.cs
- Help.cs
- IndentedWriter.cs
- DataServiceStreamResponse.cs
- SiteMapNodeItem.cs
- TypeConverterHelper.cs
- MarkupCompiler.cs
- WindowsEditBoxRange.cs
- Journal.cs
- CodeSnippetStatement.cs
- SortExpressionBuilder.cs
- CommandBinding.cs
- SqlDataSourceEnumerator.cs
- TCPClient.cs
- XmlDocument.cs
- TransformationRules.cs
- ChangeTracker.cs
- MultiBindingExpression.cs
- LostFocusEventManager.cs
- WebPartConnectionsDisconnectVerb.cs
- EntityDataSourceWrapperCollection.cs
- DomNameTable.cs
- XmlUtilWriter.cs
- GridViewDeleteEventArgs.cs
- CommandField.cs
- BadImageFormatException.cs
- DecimalConverter.cs
- NewArrayExpression.cs
- CompositionAdorner.cs
- ArrayConverter.cs
- UndoUnit.cs
- XhtmlBasicValidatorAdapter.cs
- XMLSyntaxException.cs
- CollectionContainer.cs
- Solver.cs
- SemanticKeyElement.cs
- ProcessInfo.cs
- MessageDesigner.cs
- SqlXml.cs
- TreeWalkHelper.cs
- XamlToRtfWriter.cs
- BitVector32.cs
- MetadataArtifactLoaderFile.cs
- NumberSubstitution.cs
- TypeUtils.cs
- ActivityStatusChangeEventArgs.cs
- HtmlTableRow.cs
- DataServiceClientException.cs
- TableLayoutSettings.cs
- Header.cs
- ConsoleCancelEventArgs.cs
- CalendarDay.cs
- OAVariantLib.cs
- UIPropertyMetadata.cs
- SingleQueryOperator.cs
- ValueTable.cs
- CharacterMetricsDictionary.cs
- ApplyTemplatesAction.cs
- SessionSwitchEventArgs.cs
- baseaxisquery.cs
- AccessedThroughPropertyAttribute.cs
- CombinedGeometry.cs
- DbMetaDataCollectionNames.cs
- ForeignKeyFactory.cs
- Scene3D.cs
- DbMetaDataFactory.cs
- Operators.cs
- PasswordTextNavigator.cs
- SqlDataSourceCache.cs
- EpmCustomContentSerializer.cs
- SignedXml.cs
- QilPatternFactory.cs
- XmlLangPropertyAttribute.cs
- _NTAuthentication.cs
- ListDictionary.cs
- AtomicFile.cs
- RawTextInputReport.cs
- ReadWriteControlDesigner.cs
- ServiceObjectContainer.cs
- WindowsBrush.cs
- EndpointAddress10.cs
- CharEnumerator.cs
- WebPartConnectionsConnectVerb.cs
- DataGridViewIntLinkedList.cs
- MailAddressCollection.cs
- NestPullup.cs
- ToggleButton.cs
- ServiceHostingEnvironment.cs
- odbcmetadatacollectionnames.cs
- ToolStripItemBehavior.cs
- BitmapData.cs