Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // 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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RecipientInfo.cs
- Geometry.cs
- MetadataItemSerializer.cs
- OdbcUtils.cs
- LinearKeyFrames.cs
- XmlAggregates.cs
- IntMinMaxAggregationOperator.cs
- AccessDataSourceDesigner.cs
- RelationshipDetailsRow.cs
- ObjectReferenceStack.cs
- PerformanceCounter.cs
- HtmlProps.cs
- AttributeInfo.cs
- DesignBindingValueUIHandler.cs
- DbInsertCommandTree.cs
- PropertyPath.cs
- FontUnitConverter.cs
- FileDialog_Vista_Interop.cs
- parserscommon.cs
- PageEventArgs.cs
- MarshalByValueComponent.cs
- AlternationConverter.cs
- HtmlForm.cs
- translator.cs
- EventEntry.cs
- ToolStripOverflowButton.cs
- ThemeableAttribute.cs
- ClusterUtils.cs
- WinFormsUtils.cs
- PerformanceCounterScope.cs
- WinFormsUtils.cs
- ConfigurationLocationCollection.cs
- Byte.cs
- CoTaskMemUnicodeSafeHandle.cs
- OdbcHandle.cs
- ConnectionConsumerAttribute.cs
- DropDownButton.cs
- _NetRes.cs
- FrameworkContentElement.cs
- WindowsSpinner.cs
- prompt.cs
- SmtpMail.cs
- SelectiveScrollingGrid.cs
- InputLanguageManager.cs
- XmlSerializerOperationGenerator.cs
- GridViewColumnHeaderAutomationPeer.cs
- RemoteWebConfigurationHostStream.cs
- TemplateEditingFrame.cs
- OleDbWrapper.cs
- MultiByteCodec.cs
- StorageComplexTypeMapping.cs
- Parsers.cs
- XmlSchemaSimpleContent.cs
- ServiceDescriptions.cs
- FullTextState.cs
- PathData.cs
- NonClientArea.cs
- ResourcesBuildProvider.cs
- SqlRowUpdatingEvent.cs
- FontFaceLayoutInfo.cs
- TableProviderWrapper.cs
- RuleSetReference.cs
- TypefaceMetricsCache.cs
- PositiveTimeSpanValidatorAttribute.cs
- PartialToken.cs
- X509WindowsSecurityToken.cs
- DetailsViewRowCollection.cs
- DataGridViewCellLinkedList.cs
- RightsManagementInformation.cs
- DataSourceConverter.cs
- DoubleStorage.cs
- DesignerHierarchicalDataSourceView.cs
- GatewayIPAddressInformationCollection.cs
- StorageAssociationTypeMapping.cs
- Compiler.cs
- OperatorExpressions.cs
- LayoutEditorPart.cs
- OleDbException.cs
- GPRECTF.cs
- FormsIdentity.cs
- ClientUrlResolverWrapper.cs
- GridViewHeaderRowPresenter.cs
- TraceFilter.cs
- WindowsFormsEditorServiceHelper.cs
- FontUnitConverter.cs
- DataGridView.cs
- AnimationClockResource.cs
- KeyValuePair.cs
- XmlNavigatorFilter.cs
- UrlPath.cs
- ValueProviderWrapper.cs
- RunInstallerAttribute.cs
- GetRecipientListRequest.cs
- Route.cs
- TypeResolvingOptions.cs
- GuidTagList.cs
- AdapterSwitches.cs
- webproxy.cs
- DataServiceOperationContext.cs
- XPathMultyIterator.cs