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
- DataGridTableCollection.cs
- HttpWebResponse.cs
- SafeProcessHandle.cs
- XslException.cs
- FlagsAttribute.cs
- CollectionChangeEventArgs.cs
- _OSSOCK.cs
- ExpressionVisitor.cs
- LinkDescriptor.cs
- RootProfilePropertySettingsCollection.cs
- TypeGeneratedEventArgs.cs
- GraphicsPathIterator.cs
- InputLanguageEventArgs.cs
- WebPartVerbsEventArgs.cs
- PeerName.cs
- PageAsyncTask.cs
- PersistStreamTypeWrapper.cs
- webproxy.cs
- Clock.cs
- AsymmetricAlgorithm.cs
- SmiContextFactory.cs
- MemoryResponseElement.cs
- AssociatedControlConverter.cs
- PrePostDescendentsWalker.cs
- IdentityReference.cs
- OleCmdHelper.cs
- ZipPackage.cs
- HotSpot.cs
- objectquery_tresulttype.cs
- RijndaelCryptoServiceProvider.cs
- QueueNameHelper.cs
- TextDecorationCollection.cs
- Point.cs
- MaskInputRejectedEventArgs.cs
- SchemaReference.cs
- WorkflowMarkupSerializationManager.cs
- MetadataImporter.cs
- remotingproxy.cs
- UnconditionalPolicy.cs
- AffineTransform3D.cs
- MinMaxParagraphWidth.cs
- WindowsScroll.cs
- MetadataArtifactLoaderCompositeFile.cs
- Brushes.cs
- OrCondition.cs
- IsolatedStorageFile.cs
- ImportRequest.cs
- DictionaryEntry.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- httpserverutility.cs
- ExpressionEditorAttribute.cs
- WorkerRequest.cs
- HighlightVisual.cs
- DataGridViewColumnEventArgs.cs
- WebPartConnectionCollection.cs
- ExpressionDumper.cs
- _AcceptOverlappedAsyncResult.cs
- GenericEnumerator.cs
- ListSortDescription.cs
- LinqToSqlWrapper.cs
- TimeoutValidationAttribute.cs
- TextTreeTextElementNode.cs
- AudioFormatConverter.cs
- RuntimeHandles.cs
- VectorAnimationUsingKeyFrames.cs
- ViewGenerator.cs
- Int32AnimationBase.cs
- bindurihelper.cs
- ExternalCalls.cs
- IconConverter.cs
- DragEvent.cs
- Expression.DebuggerProxy.cs
- cookie.cs
- _DomainName.cs
- RectangleF.cs
- BoundsDrawingContextWalker.cs
- CancellationHandler.cs
- CommandDevice.cs
- SrgsDocumentParser.cs
- ButtonChrome.cs
- VectorCollection.cs
- DetailsViewInsertedEventArgs.cs
- HttpContext.cs
- ZipIOExtraFieldElement.cs
- ADRole.cs
- DataKeyCollection.cs
- ComponentResourceKey.cs
- SqlDataSourceFilteringEventArgs.cs
- SqlCacheDependencySection.cs
- Marshal.cs
- XsdDuration.cs
- Vector.cs
- ClientScriptManager.cs
- ElementMarkupObject.cs
- DecoderExceptionFallback.cs
- FileDetails.cs
- DrawListViewItemEventArgs.cs
- Variant.cs
- HttpModuleCollection.cs
- EventTrigger.cs