Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }/// Converts this attribute to a string. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FigureHelper.cs
- ComponentDesigner.cs
- X509SecurityToken.cs
- DataContractJsonSerializer.cs
- ResourceContainer.cs
- CompositeActivityTypeDescriptor.cs
- TextParaLineResult.cs
- SqlProviderManifest.cs
- SoapAttributeAttribute.cs
- ParameterElement.cs
- CodeTypeDelegate.cs
- ConstantSlot.cs
- SubMenuStyleCollectionEditor.cs
- Vector3DKeyFrameCollection.cs
- SoapAttributeOverrides.cs
- EventLog.cs
- VectorKeyFrameCollection.cs
- PeerUnsafeNativeCryptMethods.cs
- DataConnectionHelper.cs
- QueryContinueDragEventArgs.cs
- TypefaceCollection.cs
- XsltQilFactory.cs
- Int16KeyFrameCollection.cs
- CngKey.cs
- BoundField.cs
- RoleManagerModule.cs
- SystemParameters.cs
- HtmlTableCell.cs
- LayoutTableCell.cs
- SpellCheck.cs
- WaitHandleCannotBeOpenedException.cs
- FlowPosition.cs
- XMLSyntaxException.cs
- FaultPropagationQuery.cs
- WinCategoryAttribute.cs
- ValidateNames.cs
- MetadataFile.cs
- SiteMapNodeItemEventArgs.cs
- BufferedGraphicsManager.cs
- DbConnectionInternal.cs
- TraceListeners.cs
- Clause.cs
- OleDbWrapper.cs
- ConfigurationCollectionAttribute.cs
- HuffModule.cs
- IItemContainerGenerator.cs
- LogAppendAsyncResult.cs
- GrabHandleGlyph.cs
- QueryOptionExpression.cs
- TraceListener.cs
- TextSegment.cs
- SID.cs
- XmlSchemaSimpleType.cs
- EditModeSwitchButton.cs
- SecurityPolicySection.cs
- SafeCoTaskMem.cs
- StorageMappingFragment.cs
- WrappedIUnknown.cs
- BufferedStream.cs
- TableColumn.cs
- PrimitiveList.cs
- Decoder.cs
- ValidatingPropertiesEventArgs.cs
- Gdiplus.cs
- CodeAccessSecurityEngine.cs
- AspCompat.cs
- InfocardChannelParameter.cs
- BookmarkCallbackWrapper.cs
- FlowDocumentFormatter.cs
- WebPartConnection.cs
- OdbcStatementHandle.cs
- AdCreatedEventArgs.cs
- XPathExpr.cs
- OletxTransactionHeader.cs
- CompilerState.cs
- NotifyCollectionChangedEventArgs.cs
- CodeTypeParameterCollection.cs
- COSERVERINFO.cs
- ConfigsHelper.cs
- XhtmlBasicFormAdapter.cs
- sortedlist.cs
- PowerModeChangedEventArgs.cs
- DataGridViewToolTip.cs
- ManipulationDeltaEventArgs.cs
- BufferedGraphicsManager.cs
- HostedElements.cs
- ExpressionNormalizer.cs
- DataSourceCacheDurationConverter.cs
- ByteRangeDownloader.cs
- DtdParser.cs
- PrimitiveDataContract.cs
- SystemIcmpV6Statistics.cs
- FileDataSourceCache.cs
- Dispatcher.cs
- AnnouncementInnerClientCD1.cs
- FileLogRecord.cs
- SafeCoTaskMem.cs
- WebPartDeleteVerb.cs
- basevalidator.cs
- GPPOINT.cs