InheritanceAttribute Класс
Определение
Указывает, является ли компонент, связанный с этим атрибутом, унаследованным от базового класса.Indicates whether the component associated with this attribute has been inherited from a base class. Этот класс не наследуется.This class cannot be inherited.
public ref class InheritanceAttribute sealed : Attribute
public sealed class InheritanceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Property)]
public sealed class InheritanceAttribute : Attribute
type InheritanceAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Property)>]
type InheritanceAttribute = class
inherit Attribute
Public NotInheritable Class InheritanceAttribute
Inherits Attribute
- Наследование
- Атрибуты
Комментарии
InheritanceAttribute представляет тип и уровень наследования элемента.InheritanceAttribute represents the type and level of inheritance of a member.
Когда AddInheritedComponents метод IInheritanceService компонента выполняет поиск по полям компонента в компоненте для обнаружения полей, унаследованных от базового класса, метод представляет уровень наследования каждого компонента с помощью InheritanceAttribute .When the AddInheritedComponents method of the IInheritanceService searches the component fields of a component to identify fields that are inherited from a base class, the method represents the inheritance level of each component using an InheritanceAttribute.
Конструкторы
InheritanceAttribute() |
Инициализирует новый экземпляр класса InheritanceAttribute.Initializes a new instance of the InheritanceAttribute class. |
InheritanceAttribute(InheritanceLevel) |
Инициализирует новый экземпляр класса InheritanceAttribute, используя указанный уровень наследования.Initializes a new instance of the InheritanceAttribute class with the specified inheritance level. |
Поля
Default |
Указывает, что значением по умолчанию для атрибута InheritanceAttribute является NotInherited.Specifies that the default value for InheritanceAttribute is NotInherited. Это поле доступно только для чтения.This field is read-only. |
Inherited |
Указывает, что компонент является унаследованным.Specifies that the component is inherited. Это поле доступно только для чтения.This field is read-only. |
InheritedReadOnly |
Определяет, что компонент является унаследованным и доступен только для чтения.Specifies that the component is inherited and is read-only. Это поле доступно только для чтения.This field is read-only. |
NotInherited |
Определяет, что компонент не является унаследованным.Specifies that the component is not inherited. Это поле доступно только для чтения.This field is read-only. |
Свойства
InheritanceLevel |
Получает или задает текущий уровень наследования, хранящийся в этом атрибуте.Gets or sets the current inheritance level stored in this attribute. |
TypeId |
В случае реализации в производном классе возвращает уникальный идентификатор для этого атрибута Attribute.When implemented in a derived class, gets a unique identifier for this Attribute. (Унаследовано от Attribute) |
Методы
Equals(Object) |
Нужно переопределить для проверки равенства.Override to test for equality. |
GetHashCode() |
Возвращает хэш-код для данного объекта.Returns the hashcode for this object. |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets the Type of the current instance. (Унаследовано от Object) |
IsDefaultAttribute() |
Возвращает значение, показывающее, является ли текущее значение атрибута его значением по умолчанию.Gets a value indicating whether the current value of the attribute is the default value for the attribute. |
Match(Object) |
При переопределении в производном классе возвращает значение, указывающее, является ли этот экземпляр равным заданному объекту.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Унаследовано от Attribute) |
MemberwiseClone() |
Создает неполную копию текущего объекта Object.Creates a shallow copy of the current Object. (Унаследовано от Object) |
ToString() |
Преобразует этот атрибут в строку.Converts this attribute to a string. |
Явные реализации интерфейса
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Сопоставляет набор имен соответствующему набору идентификаторов диспетчеризации.Maps a set of names to a corresponding set of dispatch identifiers. (Унаследовано от Attribute) |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Возвращает сведения о типе объекта, которые можно использовать для получения сведений о типе интерфейса.Retrieves the type information for an object, which can be used to get the type information for an interface. (Унаследовано от Attribute) |
_Attribute.GetTypeInfoCount(UInt32) |
Возвращает количество предоставляемых объектом интерфейсов для доступа к сведениям о типе (0 или 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Унаследовано от Attribute) |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Предоставляет доступ к открытым свойствам и методам объекта.Provides access to properties and methods exposed by an object. (Унаследовано от Attribute) |