Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / Design / InheritanceAttribute.cs / 1305376 / 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. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProviderException.cs
- _UriSyntax.cs
- BuilderPropertyEntry.cs
- TreeViewCancelEvent.cs
- SQLBoolean.cs
- IsolatedStorage.cs
- PageFunction.cs
- DrawToolTipEventArgs.cs
- PermissionSet.cs
- PathTooLongException.cs
- AsyncOperationManager.cs
- CursorInteropHelper.cs
- RemotingSurrogateSelector.cs
- WorkflowRuntimeServicesBehavior.cs
- DesignerMetadata.cs
- GridViewDesigner.cs
- PositiveTimeSpanValidator.cs
- COM2Enum.cs
- CodeCommentStatement.cs
- MultiBinding.cs
- CommonRemoteMemoryBlock.cs
- HierarchicalDataSourceControl.cs
- SQLStringStorage.cs
- ExpressionEditorAttribute.cs
- WizardSideBarListControlItem.cs
- UnitControl.cs
- EncodingDataItem.cs
- LayoutEditorPart.cs
- CompleteWizardStep.cs
- Int64Storage.cs
- ListControl.cs
- EmptyQuery.cs
- PresentationSource.cs
- HTTPNotFoundHandler.cs
- ZoomPercentageConverter.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- WebPartZone.cs
- TraceRecord.cs
- CqlLexerHelpers.cs
- _ListenerAsyncResult.cs
- GridViewUpdateEventArgs.cs
- ToolStripGrip.cs
- SoapException.cs
- ChtmlMobileTextWriter.cs
- SubMenuStyleCollectionEditor.cs
- Misc.cs
- EntityKey.cs
- NamespaceTable.cs
- XPathDocumentIterator.cs
- LifetimeServices.cs
- CodePropertyReferenceExpression.cs
- ItemCheckedEvent.cs
- UnsafeNativeMethods.cs
- EventLogEntry.cs
- DataGridColumn.cs
- ChannelSinkStacks.cs
- OletxTransactionFormatter.cs
- BooleanProjectedSlot.cs
- HtmlTableRow.cs
- Image.cs
- RegistrySecurity.cs
- LineBreak.cs
- StylusPlugInCollection.cs
- XmlDownloadManager.cs
- Win32.cs
- SchemaElementLookUpTable.cs
- CircleEase.cs
- NavigationProgressEventArgs.cs
- DateTimeOffsetAdapter.cs
- DataGridAddNewRow.cs
- TdsRecordBufferSetter.cs
- AutomationIdentifierGuids.cs
- DeflateStream.cs
- OdbcStatementHandle.cs
- ToolStripPanelRow.cs
- BookmarkEventArgs.cs
- SoapInteropTypes.cs
- CheckBoxBaseAdapter.cs
- SHA512.cs
- PropertyGrid.cs
- MailDefinitionBodyFileNameEditor.cs
- UrlMappingsModule.cs
- Quaternion.cs
- wgx_render.cs
- KnownTypesProvider.cs
- ColorConverter.cs
- ProcessHostMapPath.cs
- ConfigurationStrings.cs
- FixedDSBuilder.cs
- PrintControllerWithStatusDialog.cs
- SymmetricAlgorithm.cs
- XhtmlTextWriter.cs
- CacheVirtualItemsEvent.cs
- EntityType.cs
- InputProviderSite.cs
- CompositeFontFamily.cs
- EmptyStringExpandableObjectConverter.cs
- BaseCodeDomTreeGenerator.cs
- BindingManagerDataErrorEventArgs.cs
- XslTransformFileEditor.cs