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
- PeerApplicationLaunchInfo.cs
- Scene3D.cs
- TextBoxBase.cs
- TaskHelper.cs
- BaseUriHelper.cs
- RangeValidator.cs
- columnmapfactory.cs
- SimpleHandlerFactory.cs
- StrokeDescriptor.cs
- CompositeActivityValidator.cs
- ListViewTableRow.cs
- DiscoveryExceptionDictionary.cs
- ResourceExpressionEditor.cs
- IsolatedStorageFile.cs
- AliasGenerator.cs
- SizeAnimation.cs
- AppAction.cs
- HttpApplication.cs
- SystemInfo.cs
- RangeValidator.cs
- UnknownBitmapDecoder.cs
- LicenseProviderAttribute.cs
- TableDetailsRow.cs
- X509Utils.cs
- OleDbReferenceCollection.cs
- CodeActivity.cs
- RowToFieldTransformer.cs
- ToolStripGrip.cs
- HtmlInputFile.cs
- CounterSampleCalculator.cs
- SmiEventSink.cs
- ParameterReplacerVisitor.cs
- DoubleStorage.cs
- DataGridTextBoxColumn.cs
- WhitespaceRule.cs
- CacheAxisQuery.cs
- SoapHeaderException.cs
- HtmlTextBoxAdapter.cs
- CompatibleIComparer.cs
- TextWriter.cs
- ZipIOLocalFileDataDescriptor.cs
- ColorMap.cs
- EmbeddedMailObjectsCollection.cs
- Rect3DValueSerializer.cs
- XmlSchemaAny.cs
- XmlElement.cs
- SystemTcpConnection.cs
- DocumentApplication.cs
- AudioStateChangedEventArgs.cs
- messageonlyhwndwrapper.cs
- XmlSchemaAttributeGroup.cs
- PrintDocument.cs
- CacheMemory.cs
- Rect.cs
- ProcessHostConfigUtils.cs
- SerTrace.cs
- DataGridViewColumnEventArgs.cs
- XmlAttribute.cs
- XmlWellformedWriterHelpers.cs
- PartialCachingControl.cs
- SharedPersonalizationStateInfo.cs
- isolationinterop.cs
- DataContractJsonSerializerOperationFormatter.cs
- RuntimeResourceSet.cs
- PerformanceCounterManager.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- ProtocolState.cs
- Ipv6Element.cs
- StringAttributeCollection.cs
- DigestComparer.cs
- DesignTable.cs
- EmptyControlCollection.cs
- Psha1DerivedKeyGeneratorHelper.cs
- WebServiceClientProxyGenerator.cs
- SerialStream.cs
- Transform3DGroup.cs
- Environment.cs
- TraceUtils.cs
- XsdBuildProvider.cs
- ListBase.cs
- QualifiedCellIdBoolean.cs
- _ConnectStream.cs
- GregorianCalendar.cs
- ToolStripArrowRenderEventArgs.cs
- NodeInfo.cs
- ObjectStateEntry.cs
- Byte.cs
- GroupItem.cs
- ClientRoleProvider.cs
- IDataContractSurrogate.cs
- OrderedParallelQuery.cs
- IOException.cs
- ToolStripSettings.cs
- BindingList.cs
- NativeCppClassAttribute.cs
- FrameworkContextData.cs
- UIntPtr.cs
- AsymmetricAlgorithm.cs
- DataServiceQuery.cs
- Help.cs