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
- ToolStripSystemRenderer.cs
- _NetworkingPerfCounters.cs
- TransformGroup.cs
- VisualTreeUtils.cs
- ApplyTemplatesAction.cs
- Cell.cs
- OleDbSchemaGuid.cs
- BrowserCapabilitiesFactory35.cs
- XmlSchemaGroupRef.cs
- BigInt.cs
- ConfigurationErrorsException.cs
- ClrProviderManifest.cs
- SymDocumentType.cs
- DbDataAdapter.cs
- SecurityDescriptor.cs
- ToolStripSettings.cs
- ToolStripPanelSelectionGlyph.cs
- AddInEnvironment.cs
- _AutoWebProxyScriptWrapper.cs
- IncrementalReadDecoders.cs
- XmlSerializerFactory.cs
- DesignerActionMethodItem.cs
- Deflater.cs
- OlePropertyStructs.cs
- MetadataItem.cs
- WindowsHyperlink.cs
- TransformedBitmap.cs
- TemplateEditingVerb.cs
- SafeNativeMethodsOther.cs
- StorageInfo.cs
- DictionaryManager.cs
- InkCanvasFeedbackAdorner.cs
- DeviceContext.cs
- EventHandlerList.cs
- XmlDataSourceNodeDescriptor.cs
- MatrixAnimationUsingKeyFrames.cs
- WindowsAuthenticationModule.cs
- WebConfigurationHostFileChange.cs
- ConfigurationElementProperty.cs
- ComponentDispatcherThread.cs
- LinkedList.cs
- DataGridViewRowsAddedEventArgs.cs
- ReliabilityContractAttribute.cs
- FirstMatchCodeGroup.cs
- TableCellAutomationPeer.cs
- DataGridPageChangedEventArgs.cs
- Matrix3D.cs
- OperandQuery.cs
- ComponentDispatcherThread.cs
- StylusOverProperty.cs
- DeflateInput.cs
- ModelItemDictionary.cs
- CachedBitmap.cs
- querybuilder.cs
- SortedDictionary.cs
- LinkedList.cs
- TempFiles.cs
- SQLBytes.cs
- NonSerializedAttribute.cs
- ToolStripRenderer.cs
- DataGridViewRowPrePaintEventArgs.cs
- Visual3D.cs
- PointValueSerializer.cs
- FormViewPageEventArgs.cs
- SecureConversationVersion.cs
- DbConnectionPool.cs
- RecordManager.cs
- HelpEvent.cs
- PkcsUtils.cs
- TextTreeObjectNode.cs
- XmlAtomicValue.cs
- WebBrowserHelper.cs
- QueuePropertyVariants.cs
- ListBindableAttribute.cs
- CollectionViewGroupInternal.cs
- TableStyle.cs
- ReadOnlyNameValueCollection.cs
- NetNamedPipeSecurity.cs
- DefaultValidator.cs
- XmlDocumentSerializer.cs
- TcpTransportElement.cs
- ToolStripDropDownItem.cs
- AssertSection.cs
- WindowsAltTab.cs
- ConfigurationManagerInternalFactory.cs
- HashCryptoHandle.cs
- NamedElement.cs
- _Events.cs
- HtmlElementEventArgs.cs
- TrackingParticipant.cs
- ComponentEditorForm.cs
- CompressedStack.cs
- DataContractAttribute.cs
- WebConfigurationFileMap.cs
- BamlLocalizableResource.cs
- SQLString.cs
- FunctionImportMapping.cs
- FileRegion.cs
- CLRBindingWorker.cs
- SQLChars.cs