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
- FlowDocumentPageViewerAutomationPeer.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- Dictionary.cs
- HttpWebRequestElement.cs
- ReadOnlyPropertyMetadata.cs
- WebServicesInteroperability.cs
- Internal.cs
- BooleanAnimationBase.cs
- BackgroundWorker.cs
- TreeNodeCollection.cs
- wgx_sdk_version.cs
- XamlInt32CollectionSerializer.cs
- ComplexLine.cs
- ToolbarAUtomationPeer.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- BamlLocalizationDictionary.cs
- SponsorHelper.cs
- PenLineJoinValidation.cs
- BaseParagraph.cs
- MenuItemBindingCollection.cs
- TabControl.cs
- UriTemplatePathSegment.cs
- DmlSqlGenerator.cs
- WebScriptEnablingBehavior.cs
- Number.cs
- Image.cs
- SortAction.cs
- ServiceDocument.cs
- ScriptBehaviorDescriptor.cs
- ResponseBodyWriter.cs
- DataPagerFieldItem.cs
- NTAccount.cs
- QueryCacheManager.cs
- SqlDataSourceTableQuery.cs
- DynamicILGenerator.cs
- DirectoryGroupQuery.cs
- AssociationTypeEmitter.cs
- CompensationHandlingFilter.cs
- ProxyManager.cs
- DataGridColumn.cs
- SqlCacheDependencySection.cs
- SystemGatewayIPAddressInformation.cs
- RegexFCD.cs
- QuarticEase.cs
- EtwProvider.cs
- Vector.cs
- HostProtectionException.cs
- PieceNameHelper.cs
- CompositionAdorner.cs
- HtmlValidatorAdapter.cs
- IPEndPoint.cs
- WCFModelStrings.Designer.cs
- DispatchChannelSink.cs
- ModelFunction.cs
- MenuItemCollectionEditorDialog.cs
- UserInitiatedNavigationPermission.cs
- RadioButtonList.cs
- Win32SafeHandles.cs
- WindowInteropHelper.cs
- TreeViewImageIndexConverter.cs
- VirtualPathUtility.cs
- SafeNativeMethods.cs
- PageAdapter.cs
- ReflectionPermission.cs
- XmlCharType.cs
- PassportAuthenticationEventArgs.cs
- ConditionValidator.cs
- GridToolTip.cs
- WinFormsSecurity.cs
- CatalogZoneBase.cs
- DesignTimeParseData.cs
- NamespaceQuery.cs
- versioninfo.cs
- PhonemeEventArgs.cs
- FileLoadException.cs
- assertwrapper.cs
- TdsParserStaticMethods.cs
- KeyInterop.cs
- SourceCollection.cs
- DbDataAdapter.cs
- FaultPropagationQuery.cs
- EncoderNLS.cs
- EventLogRecord.cs
- FreeFormDesigner.cs
- Constraint.cs
- NullNotAllowedCollection.cs
- AxHost.cs
- DragSelectionMessageFilter.cs
- MemberMaps.cs
- WebPartTracker.cs
- NodeFunctions.cs
- Automation.cs
- BrushMappingModeValidation.cs
- WindowsSysHeader.cs
- SQLInt32.cs
- InvalidOleVariantTypeException.cs
- SystemTcpConnection.cs
- PenThreadWorker.cs
- Run.cs
- CacheModeValueSerializer.cs