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
- ToolStripItem.cs
- DataGridViewCellStyleEditor.cs
- ComponentResourceKey.cs
- PreviewPageInfo.cs
- CodePageEncoding.cs
- _SingleItemRequestCache.cs
- JsonQNameDataContract.cs
- EventLogger.cs
- xmlformatgeneratorstatics.cs
- ResourceBinder.cs
- EntityDataSourceView.cs
- FramingDecoders.cs
- Int32CAMarshaler.cs
- TableItemPattern.cs
- Line.cs
- Parameter.cs
- EventToken.cs
- ComPlusTypeLoader.cs
- SafeNativeMethodsMilCoreApi.cs
- FileUpload.cs
- WebUtil.cs
- DomNameTable.cs
- XPathNavigatorReader.cs
- ProtocolsConfiguration.cs
- DataContractAttribute.cs
- Drawing.cs
- FileChangesMonitor.cs
- xamlnodes.cs
- CoTaskMemHandle.cs
- HttpContextServiceHost.cs
- Component.cs
- HttpServerVarsCollection.cs
- DataGridViewSortCompareEventArgs.cs
- RadioButtonStandardAdapter.cs
- UpdatePanel.cs
- ViewGenResults.cs
- PowerModeChangedEventArgs.cs
- UmAlQuraCalendar.cs
- GrabHandleGlyph.cs
- RedirectionProxy.cs
- TemplateBamlTreeBuilder.cs
- KnownBoxes.cs
- AlgoModule.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- InvokeMethodActivityDesigner.cs
- AttachInfo.cs
- AnimationClockResource.cs
- ObjectQuery_EntitySqlExtensions.cs
- ToolStripButton.cs
- Literal.cs
- MetadataException.cs
- MetadataCollection.cs
- SqlProfileProvider.cs
- TransportManager.cs
- EditorPartDesigner.cs
- DataGridState.cs
- ReadOnlyCollection.cs
- WebDisplayNameAttribute.cs
- FormatterConverter.cs
- ToolboxItemWrapper.cs
- QueryContext.cs
- MimeXmlReflector.cs
- TextEditorTyping.cs
- Publisher.cs
- _NTAuthentication.cs
- QueryCacheEntry.cs
- DiscoveryClientDuplexChannel.cs
- OutputCache.cs
- BamlStream.cs
- AttributeCollection.cs
- Processor.cs
- ErrorWebPart.cs
- ExceptionHandler.cs
- DataTableReader.cs
- ScriptBehaviorDescriptor.cs
- AssemblyName.cs
- Viewport3DVisual.cs
- RepeaterItem.cs
- MediaEntryAttribute.cs
- CollectionViewGroupRoot.cs
- ResourceReferenceExpression.cs
- DataServiceQueryOfT.cs
- COM2ExtendedUITypeEditor.cs
- HttpHandlersSection.cs
- DBSchemaRow.cs
- XamlSerializer.cs
- DataGridViewElement.cs
- BulletedListDesigner.cs
- AddressHeaderCollection.cs
- OracleConnectionStringBuilder.cs
- BitmapEffectDrawing.cs
- ResourcePart.cs
- ApplicationInfo.cs
- WebPartAddingEventArgs.cs
- GPPOINTF.cs
- securitycriticaldata.cs
- TemplateParser.cs
- DbDataRecord.cs
- DataViewListener.cs
- DataViewSetting.cs