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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SubpageParagraph.cs
- XPathNode.cs
- RowParagraph.cs
- odbcmetadatafactory.cs
- AutomationProperties.cs
- ControlEvent.cs
- SimpleTypeResolver.cs
- AccessDataSource.cs
- XmlSchemaComplexContentRestriction.cs
- NativeCppClassAttribute.cs
- RequestQueryProcessor.cs
- RuleInfoComparer.cs
- LinqDataSourceSelectEventArgs.cs
- SafeWaitHandle.cs
- WebBrowser.cs
- RuntimeVariableList.cs
- HebrewCalendar.cs
- Tile.cs
- Int16Animation.cs
- Transform.cs
- SimpleLine.cs
- input.cs
- MediaTimeline.cs
- DataSourceControl.cs
- RadialGradientBrush.cs
- ParameterEditorUserControl.cs
- SignatureDescription.cs
- SpecialFolderEnumConverter.cs
- DBConnection.cs
- HwndKeyboardInputProvider.cs
- validationstate.cs
- HttpAsyncResult.cs
- BaseCollection.cs
- LiteralDesigner.cs
- CollectionBuilder.cs
- ConfigXmlCDataSection.cs
- AbstractExpressions.cs
- RawStylusInputCustomData.cs
- BaseEntityWrapper.cs
- MasterPageCodeDomTreeGenerator.cs
- Point4DValueSerializer.cs
- DateTimeOffset.cs
- ConstraintEnumerator.cs
- FormatterConverter.cs
- ColumnMapVisitor.cs
- GcSettings.cs
- TypedTableBase.cs
- ReadContentAsBinaryHelper.cs
- ExpandableObjectConverter.cs
- ProjectedSlot.cs
- TableCell.cs
- Stackframe.cs
- DataList.cs
- DesignerAttribute.cs
- DataGridViewRowsAddedEventArgs.cs
- CurrentChangedEventManager.cs
- ContentElement.cs
- XamlStyleSerializer.cs
- DBParameter.cs
- OpCodes.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- MsmqBindingElementBase.cs
- UnsafeNativeMethods.cs
- MediaTimeline.cs
- DetailsViewInsertedEventArgs.cs
- MenuItem.cs
- ConditionCollection.cs
- UpdateTracker.cs
- ToolStripGrip.cs
- BitArray.cs
- Int64.cs
- ColorConvertedBitmapExtension.cs
- TextBox.cs
- ListViewTableCell.cs
- ResourceBinder.cs
- ContractListAdapter.cs
- _UriSyntax.cs
- NetworkInformationException.cs
- CommandDesigner.cs
- DiscardableAttribute.cs
- SafePEFileHandle.cs
- SqlTypeSystemProvider.cs
- Hashtable.cs
- XmlReader.cs
- VectorCollectionConverter.cs
- EntityConnection.cs
- HttpListener.cs
- NonParentingControl.cs
- RNGCryptoServiceProvider.cs
- BindUriHelper.cs
- Parser.cs
- StandardToolWindows.cs
- EncoderNLS.cs
- DefaultProxySection.cs
- HyperLink.cs
- CheckedPointers.cs
- RepeaterCommandEventArgs.cs
- StateInitializationDesigner.cs
- ScriptMethodAttribute.cs
- DataGridViewAccessibleObject.cs