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
- SuppressMessageAttribute.cs
- HwndStylusInputProvider.cs
- ParameterSubsegment.cs
- XslTransformFileEditor.cs
- CustomPopupPlacement.cs
- SettingsPropertyCollection.cs
- TdsParserStateObject.cs
- PerformanceCounterPermissionAttribute.cs
- CodeTypeReferenceCollection.cs
- IndexedGlyphRun.cs
- MouseGesture.cs
- CompilerCollection.cs
- TypeInfo.cs
- ColorKeyFrameCollection.cs
- TemplatedEditableDesignerRegion.cs
- QfeChecker.cs
- DataGridPagerStyle.cs
- HtmlPageAdapter.cs
- _SpnDictionary.cs
- ElementFactory.cs
- InstanceHandle.cs
- GZipDecoder.cs
- documentsequencetextview.cs
- KernelTypeValidation.cs
- Types.cs
- PropertyGroupDescription.cs
- OdbcDataAdapter.cs
- CompoundFileDeflateTransform.cs
- AvTraceDetails.cs
- NamespaceCollection.cs
- DataTableMapping.cs
- HtmlFormParameterWriter.cs
- Win32.cs
- TypefaceMetricsCache.cs
- RegularExpressionValidator.cs
- Sequence.cs
- MatrixCamera.cs
- DependencyObjectPropertyDescriptor.cs
- ImageUrlEditor.cs
- NonParentingControl.cs
- CloudCollection.cs
- GridErrorDlg.cs
- GridViewUpdateEventArgs.cs
- NavigateEvent.cs
- LinqDataSourceInsertEventArgs.cs
- DataGridLinkButton.cs
- cryptoapiTransform.cs
- StreamUpdate.cs
- TableRowCollection.cs
- LoginView.cs
- SystemColors.cs
- CodeSnippetExpression.cs
- NoneExcludedImageIndexConverter.cs
- SamlDoNotCacheCondition.cs
- StylusOverProperty.cs
- Hex.cs
- RawStylusActions.cs
- TreeSet.cs
- ClientEventManager.cs
- DataGridViewSelectedRowCollection.cs
- mediapermission.cs
- DataFormats.cs
- XmlValidatingReaderImpl.cs
- XmlDocumentSerializer.cs
- BaseCodeDomTreeGenerator.cs
- Helpers.cs
- RuleSet.cs
- ADMembershipProvider.cs
- JournalEntryStack.cs
- XmlNavigatorStack.cs
- IdentityHolder.cs
- NameValuePair.cs
- PerspectiveCamera.cs
- TemplatedWizardStep.cs
- ReservationCollection.cs
- TreeNodeBindingDepthConverter.cs
- Pen.cs
- DataSourceProvider.cs
- GacUtil.cs
- ApplicationInfo.cs
- DetailsViewRow.cs
- X509CertificateValidator.cs
- SqlDataSource.cs
- AppearanceEditorPart.cs
- Pool.cs
- CreateSequenceResponse.cs
- LinqDataSourceUpdateEventArgs.cs
- ElementsClipboardData.cs
- InputProviderSite.cs
- OpenTypeLayoutCache.cs
- ScriptManager.cs
- OleDbPropertySetGuid.cs
- DocumentOutline.cs
- ElementAction.cs
- ImageSourceConverter.cs
- CharUnicodeInfo.cs
- BidOverLoads.cs
- XPathAncestorQuery.cs
- ShapingEngine.cs
- HtmlFormAdapter.cs