Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- CommonDialog.cs
- PriorityRange.cs
- SqlParameter.cs
- RevocationPoint.cs
- RadioButtonList.cs
- ReferencedType.cs
- LinkTarget.cs
- XamlTypeMapper.cs
- WizardStepBase.cs
- StringExpressionSet.cs
- DataGridViewCellMouseEventArgs.cs
- Signature.cs
- HtmlElement.cs
- TextEditor.cs
- DocumentViewerConstants.cs
- NativeRecognizer.cs
- SqlDependencyUtils.cs
- HierarchicalDataBoundControl.cs
- EntityClientCacheKey.cs
- RpcCryptoRequest.cs
- FeatureSupport.cs
- DataRelationPropertyDescriptor.cs
- XPathAncestorIterator.cs
- HttpPostProtocolImporter.cs
- CacheModeValueSerializer.cs
- EventDescriptorCollection.cs
- PerformanceCounter.cs
- SortedDictionary.cs
- OracleBFile.cs
- WebServiceClientProxyGenerator.cs
- SafeReversePInvokeHandle.cs
- SqlExpander.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- ConfigurationManagerHelperFactory.cs
- EntityDataSourceWrapperCollection.cs
- AtomServiceDocumentSerializer.cs
- DataTableTypeConverter.cs
- EditingScopeUndoUnit.cs
- IndentedWriter.cs
- VariantWrapper.cs
- entitydatasourceentitysetnameconverter.cs
- SimpleBitVector32.cs
- HttpWebRequest.cs
- TypeBuilderInstantiation.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- AtlasWeb.Designer.cs
- SecurityHeaderTokenResolver.cs
- StyleReferenceConverter.cs
- FrameDimension.cs
- ClientRuntimeConfig.cs
- TypeConverterHelper.cs
- __FastResourceComparer.cs
- AssertFilter.cs
- ContentFilePart.cs
- DataSourceCache.cs
- XsdDuration.cs
- DataGridViewRowCancelEventArgs.cs
- BitmapImage.cs
- filewebrequest.cs
- securitycriticaldataformultiplegetandset.cs
- SmiGettersStream.cs
- MdiWindowListStrip.cs
- ResolveCompletedEventArgs.cs
- Object.cs
- EllipseGeometry.cs
- NamedPipeConnectionPoolSettingsElement.cs
- SchemaImporterExtensionElement.cs
- BinaryUtilClasses.cs
- shaper.cs
- CapabilitiesSection.cs
- Single.cs
- ConditionCollection.cs
- ArgumentNullException.cs
- RealProxy.cs
- PeerApplicationLaunchInfo.cs
- Scene3D.cs
- RegexGroup.cs
- FixedSOMLineRanges.cs
- MonitoringDescriptionAttribute.cs
- SqlReferenceCollection.cs
- Code.cs
- AssemblyInfo.cs
- LinqExpressionNormalizer.cs
- NavigationPropertyEmitter.cs
- TextRangeAdaptor.cs
- MatrixValueSerializer.cs
- UnsafeNativeMethodsPenimc.cs
- XpsS0ValidatingLoader.cs
- Column.cs
- DataGridViewIntLinkedList.cs
- ComponentResourceKey.cs
- DescendentsWalkerBase.cs
- FrameworkElement.cs
- MDIWindowDialog.cs
- SmtpNtlmAuthenticationModule.cs
- ViewManager.cs
- HandlerFactoryCache.cs
- WebPartActionVerb.cs
- ImageAttributes.cs
- QilSortKey.cs