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
- DoubleLinkListEnumerator.cs
- WindowsListBox.cs
- XmlHierarchicalEnumerable.cs
- Point3DAnimationUsingKeyFrames.cs
- UpdatableGenericsFeature.cs
- PersonalizationDictionary.cs
- ADMembershipProvider.cs
- DocumentPageTextView.cs
- MessagePropertyFilter.cs
- DeclaredTypeValidator.cs
- TextRangeEdit.cs
- SystemBrushes.cs
- EventLogWatcher.cs
- AnyAllSearchOperator.cs
- TCPListener.cs
- GridViewColumnCollection.cs
- DropSource.cs
- ParameterElementCollection.cs
- PersistenceTypeAttribute.cs
- Component.cs
- AnnotationComponentManager.cs
- BaseComponentEditor.cs
- CodeMemberEvent.cs
- RenderTargetBitmap.cs
- FormClosedEvent.cs
- ButtonDesigner.cs
- CodeTryCatchFinallyStatement.cs
- InvalidOperationException.cs
- DataSetMappper.cs
- SqlParameter.cs
- XPathNodePointer.cs
- BitmapEffectGeneralTransform.cs
- TextParaLineResult.cs
- ClientBuildManagerCallback.cs
- PageCodeDomTreeGenerator.cs
- FormsIdentity.cs
- CodeTypeOfExpression.cs
- EventQueueState.cs
- HostingEnvironment.cs
- TdsParserStateObject.cs
- WindowsListViewGroupSubsetLink.cs
- QilDataSource.cs
- SystemInfo.cs
- MatrixTransform.cs
- InternalBufferOverflowException.cs
- Deflater.cs
- UseAttributeSetsAction.cs
- ContextBase.cs
- QueryAccessibilityHelpEvent.cs
- SQLString.cs
- AddInEnvironment.cs
- CommandLibraryHelper.cs
- Int32CAMarshaler.cs
- Function.cs
- SqlCommandSet.cs
- ContainerUtilities.cs
- DefaultSerializationProviderAttribute.cs
- RowCache.cs
- XmlSchemaSimpleContentExtension.cs
- GridViewUpdatedEventArgs.cs
- DataGridViewCellFormattingEventArgs.cs
- ServicePrincipalNameElement.cs
- SQlBooleanStorage.cs
- WizardForm.cs
- ConditionValidator.cs
- IssuedTokenParametersElement.cs
- ObjRef.cs
- IOException.cs
- Char.cs
- LinqToSqlWrapper.cs
- CqlQuery.cs
- ListBoxAutomationPeer.cs
- BeginStoryboard.cs
- WizardStepCollectionEditor.cs
- PageContent.cs
- ScrollChrome.cs
- UInt32Converter.cs
- DependsOnAttribute.cs
- Normalization.cs
- BinaryExpressionHelper.cs
- StyleModeStack.cs
- BamlRecords.cs
- SoapReflector.cs
- DTCTransactionManager.cs
- InternalRelationshipCollection.cs
- Trace.cs
- ResourceDescriptionAttribute.cs
- PropertyManager.cs
- ProcessHost.cs
- MonthCalendar.cs
- AlignmentXValidation.cs
- RichTextBoxAutomationPeer.cs
- AttributeExtensions.cs
- DataRow.cs
- DataControlImageButton.cs
- ActiveXContainer.cs
- DataProtectionSecurityStateEncoder.cs
- ProfileSection.cs
- MdiWindowListStrip.cs
- CodeObjectCreateExpression.cs