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
- TabletCollection.cs
- TextBoxAutoCompleteSourceConverter.cs
- SafeNativeMemoryHandle.cs
- TimeSpanSecondsConverter.cs
- RenamedEventArgs.cs
- ServiceBehaviorAttribute.cs
- RTLAwareMessageBox.cs
- ApplicationServicesHostFactory.cs
- TcpServerChannel.cs
- Parameter.cs
- DefaultHttpHandler.cs
- WpfWebRequestHelper.cs
- PrintPageEvent.cs
- LinkArea.cs
- XmlMapping.cs
- WeakReferenceEnumerator.cs
- DataSourceControl.cs
- ObjectAnimationUsingKeyFrames.cs
- LabelLiteral.cs
- AlternateViewCollection.cs
- DataGridViewCheckBoxCell.cs
- PointAnimationUsingKeyFrames.cs
- MissingFieldException.cs
- BindingSource.cs
- SecurityContextSecurityToken.cs
- DbResourceAllocator.cs
- ImportCatalogPart.cs
- BitmapSizeOptions.cs
- MessageCredentialType.cs
- WindowInteractionStateTracker.cs
- TemplateParser.cs
- StrokeDescriptor.cs
- NegotiateStream.cs
- MenuAutoFormat.cs
- DefaultBindingPropertyAttribute.cs
- WindowsSecurityToken.cs
- ComponentGuaranteesAttribute.cs
- DataTableExtensions.cs
- DbModificationClause.cs
- FlowPanelDesigner.cs
- TcpTransportBindingElement.cs
- UnsafeNetInfoNativeMethods.cs
- IPEndPointCollection.cs
- filewebresponse.cs
- RbTree.cs
- CodeMemberEvent.cs
- FontConverter.cs
- Grid.cs
- ImageAutomationPeer.cs
- AnimationTimeline.cs
- ImageFormat.cs
- ListComponentEditor.cs
- HttpProfileGroupBase.cs
- NativeMethods.cs
- SemaphoreSecurity.cs
- ModuleBuilderData.cs
- NavigatingCancelEventArgs.cs
- ClientRuntimeConfig.cs
- ExceptionHandlersDesigner.cs
- TextContainer.cs
- CompilerGlobalScopeAttribute.cs
- Emitter.cs
- X509Extension.cs
- NumberFormatter.cs
- ToolStripPanel.cs
- CodeObject.cs
- XmlAttributeOverrides.cs
- MaskDesignerDialog.cs
- Grant.cs
- WaitingCursor.cs
- newinstructionaction.cs
- StateDesigner.LayoutSelectionGlyph.cs
- CompareValidator.cs
- Annotation.cs
- AssemblyCacheEntry.cs
- NavigatorOutput.cs
- CursorInteropHelper.cs
- DecoderExceptionFallback.cs
- TransactionFlowElement.cs
- WrappedIUnknown.cs
- ISFTagAndGuidCache.cs
- CodePageEncoding.cs
- HtmlTextArea.cs
- COM2Enum.cs
- Lease.cs
- MdImport.cs
- SpellerInterop.cs
- PackagePartCollection.cs
- DrawingAttributesDefaultValueFactory.cs
- XamlInt32CollectionSerializer.cs
- CultureInfo.cs
- TemplatedControlDesigner.cs
- HttpWebResponse.cs
- Timer.cs
- XmlDocumentType.cs
- CharEntityEncoderFallback.cs
- WindowsAuthenticationEventArgs.cs
- mactripleDES.cs
- DependencyPropertyChangedEventArgs.cs
- SupportsEventValidationAttribute.cs