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
- LocatorPartList.cs
- EntityFrameworkVersions.cs
- WorkerRequest.cs
- ListParagraph.cs
- PropertyBuilder.cs
- WindowsComboBox.cs
- VectorAnimation.cs
- MimeMultiPart.cs
- DataGridTextBox.cs
- CharacterMetrics.cs
- ComplexPropertyEntry.cs
- DateTimeEditor.cs
- JournalNavigationScope.cs
- GeometryDrawing.cs
- CollectionViewGroupRoot.cs
- _CommandStream.cs
- EventBuilder.cs
- _emptywebproxy.cs
- TagPrefixCollection.cs
- EventHandlingScope.cs
- ConfigurationValidatorBase.cs
- SymLanguageType.cs
- ColumnBinding.cs
- BuildProvider.cs
- HttpDebugHandler.cs
- CellLabel.cs
- ColorInterpolationModeValidation.cs
- InkCanvasFeedbackAdorner.cs
- StaticResourceExtension.cs
- TreeViewItemAutomationPeer.cs
- JsonServiceDocumentSerializer.cs
- ChildDocumentBlock.cs
- AppDomainUnloadedException.cs
- RectConverter.cs
- UpdateManifestForBrowserApplication.cs
- TextDecorations.cs
- AdministrationHelpers.cs
- FontFamilyIdentifier.cs
- documentsequencetextview.cs
- MdImport.cs
- XmlNode.cs
- XmlDataSourceNodeDescriptor.cs
- ServicePointManagerElement.cs
- DocumentViewer.cs
- Stroke2.cs
- CheckBox.cs
- ChangePasswordDesigner.cs
- AnimationLayer.cs
- XmlSortKeyAccumulator.cs
- BooleanExpr.cs
- SQLMembershipProvider.cs
- AttributeConverter.cs
- UInt32.cs
- AssociationSet.cs
- AssemblyResourceLoader.cs
- Setter.cs
- InputChannelAcceptor.cs
- ZipIOFileItemStream.cs
- ToolCreatedEventArgs.cs
- BaseDataListComponentEditor.cs
- KnownBoxes.cs
- _NegoStream.cs
- FontNamesConverter.cs
- TypeConverters.cs
- MergablePropertyAttribute.cs
- AmbientLight.cs
- TextSpan.cs
- FederatedMessageSecurityOverHttpElement.cs
- ConfigXmlElement.cs
- IDQuery.cs
- DesignerAutoFormatCollection.cs
- CodeMethodMap.cs
- BaseProcessProtocolHandler.cs
- FrugalMap.cs
- XslException.cs
- TagMapInfo.cs
- PermissionSetEnumerator.cs
- COM2Enum.cs
- ConstructorBuilder.cs
- Cursors.cs
- FlowNode.cs
- EditBehavior.cs
- SafeNativeMethodsCLR.cs
- ListDictionary.cs
- SafeNativeMethodsOther.cs
- ColumnResult.cs
- RawStylusInputReport.cs
- SqlDataSourceView.cs
- Matrix.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- StrokeCollection.cs
- DynamicDiscoveryDocument.cs
- ToolBar.cs
- SourceFilter.cs
- hresults.cs
- SqlCacheDependency.cs
- EdmSchemaError.cs
- IdentityHolder.cs
- GiveFeedbackEventArgs.cs
- SelectionPatternIdentifiers.cs