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
- RuntimeComponentFilter.cs
- SqlCommandBuilder.cs
- GenericIdentity.cs
- COM2ComponentEditor.cs
- FixedSOMElement.cs
- LoginView.cs
- DrawingVisualDrawingContext.cs
- DescendentsWalker.cs
- Select.cs
- ServiceSecurityAuditBehavior.cs
- IListConverters.cs
- ServiceBusyException.cs
- PostBackTrigger.cs
- BrowserCapabilitiesCodeGenerator.cs
- RangeBaseAutomationPeer.cs
- sqlstateclientmanager.cs
- SerializationInfo.cs
- OdbcConnectionHandle.cs
- WMIInterop.cs
- HTMLTagNameToTypeMapper.cs
- DelegateArgument.cs
- HtmlTitle.cs
- RedirectionProxy.cs
- SponsorHelper.cs
- DictionaryEntry.cs
- CounterCreationData.cs
- CheckBox.cs
- ImageClickEventArgs.cs
- ExitEventArgs.cs
- FileDialog_Vista.cs
- IDQuery.cs
- Panel.cs
- XmlComment.cs
- TTSVoice.cs
- _AutoWebProxyScriptEngine.cs
- GradientSpreadMethodValidation.cs
- ReadOnlyTernaryTree.cs
- ButtonField.cs
- QuotaThrottle.cs
- PeerMaintainer.cs
- MatrixTransform.cs
- UnsafeMethods.cs
- ImageUrlEditor.cs
- UdpDiscoveryEndpoint.cs
- ReadWriteSpinLock.cs
- HMAC.cs
- SynchronizationContext.cs
- SqlDelegatedTransaction.cs
- IntegerValidatorAttribute.cs
- ParseNumbers.cs
- WorkflowViewManager.cs
- CheckBox.cs
- Variant.cs
- DataGridPageChangedEventArgs.cs
- SqlStream.cs
- returneventsaver.cs
- MultiByteCodec.cs
- BaseConfigurationRecord.cs
- TrackBar.cs
- CodePrimitiveExpression.cs
- RadioButtonPopupAdapter.cs
- Metafile.cs
- TreeNodeEventArgs.cs
- FontInfo.cs
- WebControlParameterProxy.cs
- XmlIncludeAttribute.cs
- SecurityDescriptor.cs
- SqlNodeAnnotation.cs
- EndEvent.cs
- KeyManager.cs
- DropShadowEffect.cs
- UInt64.cs
- DESCryptoServiceProvider.cs
- MessageQueuePermission.cs
- InternalControlCollection.cs
- SymbolMethod.cs
- DataControlLinkButton.cs
- ReflectionTypeLoadException.cs
- TextTrailingWordEllipsis.cs
- TextElement.cs
- ToolStripControlHost.cs
- UniqueConstraint.cs
- Maps.cs
- DefaultValueTypeConverter.cs
- SignatureDescription.cs
- ReadOnlyHierarchicalDataSourceView.cs
- FlowDocumentFormatter.cs
- ProcessRequestArgs.cs
- DataGridViewImageCell.cs
- ThreadExceptionDialog.cs
- WsatTransactionInfo.cs
- _LocalDataStore.cs
- SingletonConnectionReader.cs
- Int16Converter.cs
- Delay.cs
- Attachment.cs
- Pair.cs
- FilterElement.cs
- ErrorRuntimeConfig.cs
- FunctionImportMapping.cs