Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / Design / InheritanceAttribute.cs / 1 / InheritanceAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event)] public sealed class InheritanceAttribute : Attribute { private readonly InheritanceLevel inheritanceLevel; ///Marks instances of objects that are inherited from their base class. This /// class cannot be inherited. ////// public static readonly InheritanceAttribute Inherited = new InheritanceAttribute(InheritanceLevel.Inherited); ////// Specifies that the component is inherited. This field is /// read-only. /// ////// public static readonly InheritanceAttribute InheritedReadOnly = new InheritanceAttribute(InheritanceLevel.InheritedReadOnly); ////// Specifies that /// the component is inherited and is read-only. This field is /// read-only. /// ////// public static readonly InheritanceAttribute NotInherited = new InheritanceAttribute(InheritanceLevel.NotInherited); ////// Specifies that the component is not inherited. This field is /// read-only. /// ////// public static readonly InheritanceAttribute Default = NotInherited; ////// Specifies the default value for /// the InheritanceAttribute as NotInherited. /// ////// public InheritanceAttribute() { inheritanceLevel = Default.inheritanceLevel; } ///Initializes a new instance of the System.ComponentModel.Design.InheritanceAttribute /// class. ////// public InheritanceAttribute(InheritanceLevel inheritanceLevel) { this.inheritanceLevel = inheritanceLevel; } ///Initializes a new instance of the System.ComponentModel.Design.InheritanceAttribute class /// with the specified inheritance /// level. ////// public InheritanceLevel InheritanceLevel { get { return inheritanceLevel; } } ////// Gets or sets /// the current inheritance level stored in this attribute. /// ////// public override bool Equals(object value) { if (value == this) { return true; } if (!(value is InheritanceAttribute)) { return false; } InheritanceLevel valueLevel = ((InheritanceAttribute)value).InheritanceLevel; return (valueLevel == inheritanceLevel); } ////// Override to test for equality. /// ////// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// public override bool IsDefaultAttribute() { return (this.Equals(Default)); } ////// Gets whether this attribute is the default. /// ////// public override string ToString() { return TypeDescriptor.GetConverter(typeof(InheritanceLevel)).ConvertToString(InheritanceLevel); } } }/// Converts this attribute to a string. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColorAnimation.cs
- Renderer.cs
- ActivityExecutorSurrogate.cs
- TargetPerspective.cs
- AuthenticationSection.cs
- SqlUserDefinedAggregateAttribute.cs
- PtsCache.cs
- DataGridViewLayoutData.cs
- KeyedPriorityQueue.cs
- ProcessModule.cs
- DataViewManagerListItemTypeDescriptor.cs
- NamedPipeChannelListener.cs
- Encoder.cs
- Panel.cs
- CustomErrorCollection.cs
- MimePart.cs
- Activator.cs
- ProfileSettings.cs
- ObjectDataSourceMethodEventArgs.cs
- WSHttpBindingElement.cs
- TimeIntervalCollection.cs
- WebPartManager.cs
- BamlStream.cs
- BreakRecordTable.cs
- Model3DGroup.cs
- PersonalizationEntry.cs
- ExpressionParser.cs
- UnsafeNativeMethods.cs
- ItemCheckedEvent.cs
- Encoder.cs
- MetadataPropertyvalue.cs
- ExpressionBuilder.cs
- mediaeventargs.cs
- TraceUtils.cs
- RenderingBiasValidation.cs
- PrefixQName.cs
- UnmanagedBitmapWrapper.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- NativeObjectSecurity.cs
- MethodInfo.cs
- TextBreakpoint.cs
- WebPartDisplayModeCollection.cs
- XPathExpr.cs
- StandardTransformFactory.cs
- PeerEndPoint.cs
- ChannelCredentials.cs
- XsltOutput.cs
- COM2PropertyBuilderUITypeEditor.cs
- _NetRes.cs
- UnsafeNativeMethods.cs
- _ContextAwareResult.cs
- SamlAudienceRestrictionCondition.cs
- TypeReference.cs
- X500Name.cs
- MyContact.cs
- MimeFormImporter.cs
- TransformValueSerializer.cs
- NativeMethods.cs
- ListViewContainer.cs
- ProcessModelSection.cs
- MemoryStream.cs
- WebUtil.cs
- EnumValAlphaComparer.cs
- GridViewRowEventArgs.cs
- DataColumnCollection.cs
- BinaryUtilClasses.cs
- TouchEventArgs.cs
- LOSFormatter.cs
- RIPEMD160.cs
- UriTemplateTrieNode.cs
- FormsAuthenticationEventArgs.cs
- SQLStringStorage.cs
- GroupBoxRenderer.cs
- TraceListeners.cs
- Helper.cs
- QilNode.cs
- PageThemeBuildProvider.cs
- RegisteredDisposeScript.cs
- MediaContext.cs
- XmlCompatibilityReader.cs
- DocumentXmlWriter.cs
- PagesChangedEventArgs.cs
- ExpressionLink.cs
- HttpHeaderCollection.cs
- HtmlHistory.cs
- EntityContainer.cs
- StateDesigner.TransitionInfo.cs
- GridViewRowPresenterBase.cs
- XmlValidatingReaderImpl.cs
- WindowsListViewScroll.cs
- BulletChrome.cs
- MultiAsyncResult.cs
- DataViewManager.cs
- ReferenceConverter.cs
- _ContextAwareResult.cs
- TimersDescriptionAttribute.cs
- ControlIdConverter.cs
- DiscoveryDocument.cs
- StringStorage.cs
- NotifyParentPropertyAttribute.cs