Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / Design / InheritanceAttribute.cs / 1305376 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Converts this attribute to a string. /// ///// 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Converts this attribute to a string. /// ///
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetaModel.cs
- CellTreeNode.cs
- WebEventTraceProvider.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- RoleServiceManager.cs
- FacetChecker.cs
- PlatformCulture.cs
- SmtpCommands.cs
- CustomCategoryAttribute.cs
- CompilerError.cs
- SoapAttributeAttribute.cs
- SQLRoleProvider.cs
- CqlGenerator.cs
- SetterBaseCollection.cs
- ArithmeticException.cs
- BufferedGraphicsManager.cs
- XPathSelfQuery.cs
- SqlOuterApplyReducer.cs
- UnhandledExceptionEventArgs.cs
- Pair.cs
- SymmetricKey.cs
- ObjectListItem.cs
- AnonymousIdentificationSection.cs
- MessageSecurityVersionConverter.cs
- BooleanAnimationUsingKeyFrames.cs
- CommonRemoteMemoryBlock.cs
- RenderData.cs
- CompilationUtil.cs
- ServiceDesigner.xaml.cs
- ToolStripContentPanel.cs
- TreeViewTemplateSelector.cs
- KoreanLunisolarCalendar.cs
- RandomNumberGenerator.cs
- InfoCardBaseException.cs
- WrappedIUnknown.cs
- DesignerCategoryAttribute.cs
- MatrixIndependentAnimationStorage.cs
- MultipleViewPattern.cs
- LicFileLicenseProvider.cs
- DecoderReplacementFallback.cs
- DataListItemEventArgs.cs
- DatagridviewDisplayedBandsData.cs
- SQLDateTime.cs
- SystemUdpStatistics.cs
- WindowsGraphics.cs
- BindingExpressionUncommonField.cs
- RequestCache.cs
- StringBuilder.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ContextDataSourceContextData.cs
- SoapFaultCodes.cs
- OleDragDropHandler.cs
- AppearanceEditorPart.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- FormDocumentDesigner.cs
- DbProviderFactories.cs
- ClientConvert.cs
- EventsTab.cs
- SSmlParser.cs
- OracleSqlParser.cs
- Hash.cs
- DataService.cs
- SplashScreen.cs
- Win32SafeHandles.cs
- ErrorActivity.cs
- PropertySegmentSerializationProvider.cs
- Win32.cs
- HiddenField.cs
- DataGridViewSelectedCellCollection.cs
- OutputScope.cs
- MarkupObject.cs
- GradientStop.cs
- DetailsViewRow.cs
- HttpUnhandledOperationInvoker.cs
- ListViewInsertedEventArgs.cs
- OperationInfo.cs
- ProxyWebPartConnectionCollection.cs
- remotingproxy.cs
- Types.cs
- MetadataHelper.cs
- FileDialogCustomPlace.cs
- SerialPinChanges.cs
- ClientConfigurationSystem.cs
- InstallerTypeAttribute.cs
- XmlIterators.cs
- CheckBoxPopupAdapter.cs
- PrimarySelectionGlyph.cs
- Point3DKeyFrameCollection.cs
- LoginCancelEventArgs.cs
- FrameworkElement.cs
- Block.cs
- DllNotFoundException.cs
- GridPattern.cs
- FormsAuthenticationModule.cs
- QilCloneVisitor.cs
- SqlError.cs
- DoubleIndependentAnimationStorage.cs
- Resources.Designer.cs
- ColorInterpolationModeValidation.cs
- Collection.cs