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
- ExtendedProtectionPolicyTypeConverter.cs
- DiagnosticsConfiguration.cs
- GrammarBuilderDictation.cs
- PackagePartCollection.cs
- HandlerMappingMemo.cs
- ConnectionManagementSection.cs
- HtmlInputReset.cs
- OracleCommand.cs
- WmlLinkAdapter.cs
- AdditionalEntityFunctions.cs
- TriState.cs
- DynamicHyperLink.cs
- XPathScanner.cs
- RequestStatusBarUpdateEventArgs.cs
- HasCopySemanticsAttribute.cs
- WeakReadOnlyCollection.cs
- WebDescriptionAttribute.cs
- DBDataPermissionAttribute.cs
- PropVariant.cs
- Geometry3D.cs
- PreloadedPackages.cs
- FontFamilyValueSerializer.cs
- DbConnectionPool.cs
- Path.cs
- ModifiableIteratorCollection.cs
- StrongNameIdentityPermission.cs
- ContextInformation.cs
- MessageRpc.cs
- InputScope.cs
- EdmConstants.cs
- SystemEvents.cs
- SimpleExpression.cs
- TrackingAnnotationCollection.cs
- DataGridViewLayoutData.cs
- VsPropertyGrid.cs
- DataRowExtensions.cs
- TagPrefixAttribute.cs
- ConnectionManagementElementCollection.cs
- DbConnectionPoolGroupProviderInfo.cs
- ContravarianceAdapter.cs
- CompositeDispatchFormatter.cs
- Validator.cs
- EntryPointNotFoundException.cs
- ImageClickEventArgs.cs
- TabControl.cs
- AddInControllerImpl.cs
- Boolean.cs
- TimeZone.cs
- XmlEntityReference.cs
- BaseDataListDesigner.cs
- OleDbError.cs
- TraceEventCache.cs
- Point3DIndependentAnimationStorage.cs
- XsdSchemaFileEditor.cs
- LogPolicy.cs
- HMACSHA1.cs
- TreeNode.cs
- ParameterModifier.cs
- MeasurementDCInfo.cs
- ModelChangedEventArgsImpl.cs
- EntityDescriptor.cs
- Buffer.cs
- XmlNodeReader.cs
- ResolvedKeyFrameEntry.cs
- PeerResolver.cs
- TypedTableBaseExtensions.cs
- DbConnectionInternal.cs
- SBCSCodePageEncoding.cs
- OnOperation.cs
- COM2ExtendedUITypeEditor.cs
- BroadcastEventHelper.cs
- Util.cs
- ActionFrame.cs
- SweepDirectionValidation.cs
- GeneralTransform3DGroup.cs
- StreamUpdate.cs
- CapabilitiesState.cs
- GlobalItem.cs
- XmlSchemaRedefine.cs
- SpeechRecognizer.cs
- StaticExtension.cs
- TextElement.cs
- RawStylusSystemGestureInputReport.cs
- ApplicationSecurityInfo.cs
- ToggleButton.cs
- UrlParameterWriter.cs
- TypeInformation.cs
- DataTableReaderListener.cs
- DropDownList.cs
- RequestSecurityTokenResponse.cs
- WindowsContainer.cs
- HttpListenerPrefixCollection.cs
- recordstatescratchpad.cs
- Image.cs
- BaseTemplateBuildProvider.cs
- WeakReference.cs
- LabelAutomationPeer.cs
- LassoHelper.cs
- FileVersionInfo.cs
- PermissionAttributes.cs