Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RIPEMD160Managed.cs
- LambdaCompiler.Expressions.cs
- StylusDevice.cs
- CollectionBuilder.cs
- TransactionFlowElement.cs
- ReferenceEqualityComparer.cs
- connectionpool.cs
- ParagraphVisual.cs
- PreviewPageInfo.cs
- CLSCompliantAttribute.cs
- CallbackHandler.cs
- DbMetaDataFactory.cs
- LinkButton.cs
- TextTreeInsertElementUndoUnit.cs
- EncodingDataItem.cs
- SwitchAttribute.cs
- ListCollectionView.cs
- Typography.cs
- DocumentSequence.cs
- DataListCommandEventArgs.cs
- SystemTcpStatistics.cs
- PageRequestManager.cs
- DBCSCodePageEncoding.cs
- UnicodeEncoding.cs
- XamlTreeBuilderBamlRecordWriter.cs
- XamlTreeBuilderBamlRecordWriter.cs
- UrlSyndicationContent.cs
- CacheMemory.cs
- UserControlCodeDomTreeGenerator.cs
- IisTraceWebEventProvider.cs
- QilGenerator.cs
- Image.cs
- SoapSchemaMember.cs
- CheckBoxDesigner.cs
- SelectionBorderGlyph.cs
- CodeExporter.cs
- ItemDragEvent.cs
- SecurityElement.cs
- WebBrowserHelper.cs
- CultureMapper.cs
- BindingCompleteEventArgs.cs
- MembershipUser.cs
- StringConcat.cs
- ProxyManager.cs
- CapabilitiesState.cs
- RequestBringIntoViewEventArgs.cs
- x509store.cs
- DataGridViewRowConverter.cs
- dataprotectionpermission.cs
- ListContractAdapter.cs
- XmlWriterTraceListener.cs
- DataShape.cs
- FileCodeGroup.cs
- DataSet.cs
- XmlSchemaGroup.cs
- PersonalizablePropertyEntry.cs
- QilExpression.cs
- WindowsRegion.cs
- XNodeNavigator.cs
- PseudoWebRequest.cs
- NavigationPropertyEmitter.cs
- autovalidator.cs
- EnumConverter.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TypeDescriptionProviderAttribute.cs
- MessageDesigner.cs
- XmlWellformedWriter.cs
- XamlBrushSerializer.cs
- AssemblyCache.cs
- ListViewSelectEventArgs.cs
- ScriptReferenceBase.cs
- CacheOutputQuery.cs
- JapaneseCalendar.cs
- FixedMaxHeap.cs
- ClusterUtils.cs
- DataPagerField.cs
- LoadGrammarCompletedEventArgs.cs
- UpdateProgress.cs
- HebrewCalendar.cs
- EmptyCollection.cs
- Parser.cs
- UInt64.cs
- MemberNameValidator.cs
- DisableDpiAwarenessAttribute.cs
- XPathNodePointer.cs
- GraphicsPathIterator.cs
- ImageUrlEditor.cs
- MulticastOption.cs
- TextEncodedRawTextWriter.cs
- FlowDocumentView.cs
- FamilyTypefaceCollection.cs
- SafeProcessHandle.cs
- Transactions.cs
- TableStyle.cs
- NavigationWindowAutomationPeer.cs
- SoapIncludeAttribute.cs
- SpellerStatusTable.cs
- TemplateApplicationHelper.cs
- StateManagedCollection.cs
- BaseDataListDesigner.cs