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
- EntityViewGenerator.cs
- XmlNamespaceManager.cs
- recordstate.cs
- Label.cs
- Transform3D.cs
- XamlTypeWithExplicitNamespace.cs
- ScrollBar.cs
- DataGridViewRowCollection.cs
- PointLightBase.cs
- StateBag.cs
- InternalDuplexChannelListener.cs
- Ray3DHitTestResult.cs
- DrawingContext.cs
- WebServiceReceiveDesigner.cs
- Polygon.cs
- ToolStripItemTextRenderEventArgs.cs
- WebPartZoneBase.cs
- DbResourceAllocator.cs
- CuspData.cs
- PriorityQueue.cs
- EnumerableValidator.cs
- TextServicesProperty.cs
- VirtualDirectoryMapping.cs
- RightsManagementPermission.cs
- StorageComplexTypeMapping.cs
- SourceFileBuildProvider.cs
- TextEditorCharacters.cs
- MobileControlPersister.cs
- UserControlAutomationPeer.cs
- AnnotationAuthorChangedEventArgs.cs
- Model3DGroup.cs
- SecurityState.cs
- ToolboxComponentsCreatingEventArgs.cs
- XmlObjectSerializer.cs
- WindowsListViewGroupHelper.cs
- DesignerTransactionCloseEvent.cs
- SessionSwitchEventArgs.cs
- BinaryCommonClasses.cs
- SqlRowUpdatingEvent.cs
- XmlMemberMapping.cs
- DateTimeFormatInfoScanner.cs
- KeyConverter.cs
- SuspendDesigner.cs
- DecoderFallback.cs
- NotificationContext.cs
- WebResourceUtil.cs
- SystemKeyConverter.cs
- InvalidCastException.cs
- FloaterBaseParagraph.cs
- Guid.cs
- ValueExpressions.cs
- TimeSpan.cs
- ConfigurationLockCollection.cs
- XslCompiledTransform.cs
- Int32Storage.cs
- ToolBarPanel.cs
- oledbconnectionstring.cs
- XmlQueryTypeFactory.cs
- ActiveXMessageFormatter.cs
- RequestBringIntoViewEventArgs.cs
- CultureTableRecord.cs
- RelationshipEndCollection.cs
- TemplatedEditableDesignerRegion.cs
- FormViewInsertedEventArgs.cs
- UrlMapping.cs
- CodeMemberEvent.cs
- DeobfuscatingStream.cs
- DataGridTableCollection.cs
- Math.cs
- HtmlInputReset.cs
- ShellProvider.cs
- InvalidOleVariantTypeException.cs
- MailFileEditor.cs
- SQLDoubleStorage.cs
- OpenFileDialog.cs
- LinkButton.cs
- XPathQilFactory.cs
- OleDbTransaction.cs
- TextChange.cs
- SingleConverter.cs
- SerializationException.cs
- StringValidator.cs
- BinHexDecoder.cs
- Int16Converter.cs
- MethodCallTranslator.cs
- PostBackTrigger.cs
- InvalidCastException.cs
- CatalogPartDesigner.cs
- TdsParserSessionPool.cs
- CompositeControl.cs
- VoiceObjectToken.cs
- _DisconnectOverlappedAsyncResult.cs
- PermissionRequestEvidence.cs
- CompoundFileDeflateTransform.cs
- DoubleIndependentAnimationStorage.cs
- PathTooLongException.cs
- SystemWebSectionGroup.cs
- TextReader.cs
- RewritingPass.cs
- KeyedQueue.cs