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
- IfJoinedCondition.cs
- SettingsSection.cs
- ServicePrincipalNameElement.cs
- WebPartMovingEventArgs.cs
- ListControlConvertEventArgs.cs
- DefaultTextStoreTextComposition.cs
- ActivityExecutionWorkItem.cs
- SimpleType.cs
- PolicyValidationException.cs
- EDesignUtil.cs
- XamlSerializerUtil.cs
- ListenDesigner.cs
- SiteMapProvider.cs
- MailSettingsSection.cs
- StringResourceManager.cs
- SessionStateUtil.cs
- RowToFieldTransformer.cs
- WSUtilitySpecificationVersion.cs
- DispatcherSynchronizationContext.cs
- IgnoreFileBuildProvider.cs
- SplitterEvent.cs
- x509store.cs
- _Win32.cs
- ListBindingHelper.cs
- ProviderConnectionPointCollection.cs
- PageStatePersister.cs
- SessionStateSection.cs
- DeclarativeCatalogPartDesigner.cs
- MSAANativeProvider.cs
- MulticastNotSupportedException.cs
- PropertyToken.cs
- AddingNewEventArgs.cs
- XmlBinaryReader.cs
- DbParameterHelper.cs
- SelectionBorderGlyph.cs
- DescendentsWalkerBase.cs
- JapaneseLunisolarCalendar.cs
- IntegerValidatorAttribute.cs
- PingOptions.cs
- XmlSchemaFacet.cs
- WebBrowserDocumentCompletedEventHandler.cs
- XmlHelper.cs
- _LazyAsyncResult.cs
- Transactions.cs
- _DomainName.cs
- Transform3DCollection.cs
- MsmqSecureHashAlgorithm.cs
- ArrangedElementCollection.cs
- GenerateHelper.cs
- KerberosReceiverSecurityToken.cs
- StyleCollection.cs
- AttributeCollection.cs
- WizardStepBase.cs
- PresentationAppDomainManager.cs
- ObjectConverter.cs
- X509CertificateStore.cs
- DataGrid.cs
- RightNameExpirationInfoPair.cs
- ResourcesChangeInfo.cs
- XmlRawWriter.cs
- ColumnResult.cs
- Authorization.cs
- NotifyCollectionChangedEventArgs.cs
- EllipseGeometry.cs
- StorageSetMapping.cs
- CodeRegionDirective.cs
- GridViewPageEventArgs.cs
- nulltextnavigator.cs
- FontFamilyConverter.cs
- Size.cs
- EntityDataSourceView.cs
- ViewSimplifier.cs
- KoreanLunisolarCalendar.cs
- MsmqMessage.cs
- BatchStream.cs
- FrameDimension.cs
- Rect3DValueSerializer.cs
- Part.cs
- BufferedMessageWriter.cs
- StylusOverProperty.cs
- ProcessModule.cs
- CSharpCodeProvider.cs
- TreeViewCancelEvent.cs
- TreeChangeInfo.cs
- SoapMessage.cs
- FrameworkObject.cs
- ValuePatternIdentifiers.cs
- HtmlTernaryTree.cs
- TdsEnums.cs
- FilteredDataSetHelper.cs
- DataGridViewCellValidatingEventArgs.cs
- BamlTreeUpdater.cs
- OperationBehaviorAttribute.cs
- DynamicPropertyHolder.cs
- CachedFontFace.cs
- WindowsListViewGroup.cs
- Parsers.cs
- InvalidPropValue.cs
- WebPart.cs
- DbgUtil.cs