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
- ParenthesizePropertyNameAttribute.cs
- NullableConverter.cs
- XmlUtil.cs
- FolderBrowserDialog.cs
- FrameworkElementAutomationPeer.cs
- XamlPathDataSerializer.cs
- IndexedString.cs
- ControlAdapter.cs
- ReadOnlyNameValueCollection.cs
- UnsafeNativeMethods.cs
- CompileXomlTask.cs
- PathGeometry.cs
- DefaultHttpHandler.cs
- connectionpool.cs
- SimpleRecyclingCache.cs
- HttpProfileBase.cs
- SafeRightsManagementHandle.cs
- ClientConvert.cs
- DataRowChangeEvent.cs
- TogglePattern.cs
- PassportAuthenticationModule.cs
- ComAdminWrapper.cs
- XmlSortKeyAccumulator.cs
- Permission.cs
- DesignBindingEditor.cs
- Permission.cs
- DocumentOrderQuery.cs
- Compilation.cs
- HtmlEmptyTagControlBuilder.cs
- ClientRoleProvider.cs
- AnchorEditor.cs
- _UncName.cs
- SearchForVirtualItemEventArgs.cs
- PathData.cs
- SecurityPolicySection.cs
- CompareInfo.cs
- LogArchiveSnapshot.cs
- EntityDataSourceContextCreatingEventArgs.cs
- SafeFileMappingHandle.cs
- ScalarType.cs
- WorkflowFileItem.cs
- RuntimeHandles.cs
- SrgsToken.cs
- NullReferenceException.cs
- DynamicValidatorEventArgs.cs
- NumericUpDown.cs
- ArgumentOutOfRangeException.cs
- XmlDigitalSignatureProcessor.cs
- ToolTip.cs
- RenderData.cs
- smtppermission.cs
- ProcessHostFactoryHelper.cs
- ListViewUpdatedEventArgs.cs
- NegationPusher.cs
- DbParameterCollectionHelper.cs
- HwndHostAutomationPeer.cs
- CanonicalFontFamilyReference.cs
- MetadataCacheItem.cs
- ResourceDisplayNameAttribute.cs
- VisualCollection.cs
- FileIOPermission.cs
- ObjectDataSource.cs
- ExceptionUtil.cs
- GeometryModel3D.cs
- QuotedPrintableStream.cs
- QueryOptionExpression.cs
- XPathExpr.cs
- XmlDataSourceView.cs
- MetadataCacheItem.cs
- PreDigestedSignedInfo.cs
- GPPOINT.cs
- IdnMapping.cs
- LocationSectionRecord.cs
- SqlProfileProvider.cs
- SiteOfOriginPart.cs
- EncoderBestFitFallback.cs
- ObjectNotFoundException.cs
- PasswordBox.cs
- TextViewElement.cs
- PermissionListSet.cs
- DocumentCollection.cs
- DataFieldConverter.cs
- PersonalizationAdministration.cs
- RuntimeConfig.cs
- ListControlConvertEventArgs.cs
- ResourceSetExpression.cs
- CodeTypeOfExpression.cs
- ReturnEventArgs.cs
- TransformerInfoCollection.cs
- SqlPersonalizationProvider.cs
- ToolboxItemAttribute.cs
- RNGCryptoServiceProvider.cs
- UInt16.cs
- Rect.cs
- DispatcherProcessingDisabled.cs
- TypeConverterHelper.cs
- HttpCookieCollection.cs
- SymDocumentType.cs
- GenericPrincipal.cs
- XamlReaderHelper.cs