Code:
/ FX-1434 / FX-1434 / 1.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
- PopOutPanel.cs
- ToolBarButton.cs
- DataGridHeaderBorder.cs
- ClientEventManager.cs
- TransactionContext.cs
- PathFigureCollectionValueSerializer.cs
- JsonReaderDelegator.cs
- XmlArrayAttribute.cs
- HttpServerVarsCollection.cs
- TextEffect.cs
- SafeMemoryMappedFileHandle.cs
- FontUnit.cs
- RandomNumberGenerator.cs
- FormsAuthenticationEventArgs.cs
- AssemblyCollection.cs
- XmlName.cs
- SourceLineInfo.cs
- SystemWebCachingSectionGroup.cs
- SqlStream.cs
- SqlNodeAnnotations.cs
- TracingConnection.cs
- TextTreeObjectNode.cs
- XPathParser.cs
- StaticTextPointer.cs
- FormsAuthentication.cs
- ListBox.cs
- DataGridViewSelectedCellCollection.cs
- TreeNodeCollection.cs
- BulletedListDesigner.cs
- PerfCounters.cs
- RawStylusSystemGestureInputReport.cs
- DataTableReader.cs
- InvokeProviderWrapper.cs
- DelegateBodyWriter.cs
- CodeSnippetStatement.cs
- DataBindingExpressionBuilder.cs
- GetResponse.cs
- TextTreeObjectNode.cs
- DesignTimeHTMLTextWriter.cs
- QueryOutputWriter.cs
- HtmlInputImage.cs
- WebResponse.cs
- BindingSource.cs
- DocumentApplicationJournalEntry.cs
- RTLAwareMessageBox.cs
- LinqDataSourceInsertEventArgs.cs
- RoleManagerSection.cs
- XmlILTrace.cs
- SpellerInterop.cs
- AnnotationResourceCollection.cs
- AutomationIdentifier.cs
- TypeConstant.cs
- XappLauncher.cs
- OleDbConnection.cs
- XPathSingletonIterator.cs
- DispatcherOperation.cs
- XPathBinder.cs
- DispatcherFrame.cs
- GZipDecoder.cs
- GridViewHeaderRowPresenter.cs
- CellQuery.cs
- UnknownBitmapDecoder.cs
- NumberFunctions.cs
- Profiler.cs
- RTLAwareMessageBox.cs
- DetailsViewInsertedEventArgs.cs
- FileSystemEventArgs.cs
- CodeExporter.cs
- RefType.cs
- WebPartConnectionCollection.cs
- SqlDataSourceQuery.cs
- WindowsListViewGroupSubsetLink.cs
- EventLogException.cs
- ProjectionPruner.cs
- XmlHelper.cs
- WebPermission.cs
- CalendarButton.cs
- LinqDataSourceHelper.cs
- WebPartConnectionsCancelVerb.cs
- PerformanceCounterNameAttribute.cs
- _SslSessionsCache.cs
- httpserverutility.cs
- WebHeaderCollection.cs
- XpsViewerException.cs
- CodeArrayIndexerExpression.cs
- SystemIPAddressInformation.cs
- RelatedPropertyManager.cs
- Rfc2898DeriveBytes.cs
- HtmlInputText.cs
- SmtpException.cs
- WindowsListViewItemStartMenu.cs
- StyleSelector.cs
- DBCommand.cs
- _NetworkingPerfCounters.cs
- JournalEntryListConverter.cs
- DoubleAnimationBase.cs
- HeaderLabel.cs
- ComboBoxRenderer.cs
- TypeDescriptorFilterService.cs
- XmlAttributes.cs