SupportedOSPlatformAttribute Класс
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Указывает, что API поддерживается для указанной платформы или операционной системы. Если указана версия, API не может вызываться из более ранней версии. Для указания поддержки в нескольких операционных системах можно применять несколько атрибутов.
public ref class SupportedOSPlatformAttribute sealed : System::Runtime::Versioning::OSPlatformAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class SupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class SupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SupportedOSPlatformAttribute = class
inherit OSPlatformAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SupportedOSPlatformAttribute = class
inherit OSPlatformAttribute
Public NotInheritable Class SupportedOSPlatformAttribute
Inherits OSPlatformAttribute
- Наследование
- Атрибуты
Комментарии
Вызывающие пользователи могут применять SupportedOSPlatformAttribute или использовать охранники, чтобы предотвратить вызовы API в неподдерживаемых операционных системах. Указанная платформа должна быть указана только один раз.
Конструкторы
| Имя | Описание |
|---|---|
| SupportedOSPlatformAttribute(String) |
Инициализирует новый экземпляр класса атрибута для указанной SupportedOSPlatformAttribute поддерживаемой платформы ОС. |
Свойства
| Имя | Описание |
|---|---|
| PlatformName |
Возвращает имя и необязательную версию платформы, к которому применяется атрибут. (Унаследовано от OSPlatformAttribute) |
| TypeId |
При реализации в производном классе получает уникальный идентификатор для этого Attribute. (Унаследовано от Attribute) |
Методы
| Имя | Описание |
|---|---|
| Equals(Object) |
Возвращает значение, указывающее, равен ли этот экземпляр указанному объекту. (Унаследовано от Attribute) |
| GetHashCode() |
Возвращает хэш-код для этого экземпляра. (Унаследовано от Attribute) |
| GetType() |
Возвращает Type текущего экземпляра. (Унаследовано от Object) |
| IsDefaultAttribute() |
При переопределении в производном классе указывает, является ли значение этого экземпляра значением по умолчанию для производного класса. (Унаследовано от Attribute) |
| Match(Object) |
При переопределении в производном классе возвращает значение, указывающее, равен ли этот экземпляр указанному объекту. (Унаследовано от Attribute) |
| MemberwiseClone() |
Создает неглубокую копию текущей Object. (Унаследовано от Object) |
| ToString() |
Возвращает строку, представляющую текущий объект. (Унаследовано от Object) |