SupportedOSPlatformGuardAttribute Klasa

Definicja

Dodaje adnotacje do niestandardowego pola, właściwości lub metody z obsługiwaną nazwą platformy i opcjonalną wersją. Można zastosować wiele atrybutów, aby wskazać ochronę dla wielu obsługiwanych platform.

public ref class SupportedOSPlatformGuardAttribute sealed : System::Runtime::Versioning::OSPlatformAttribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)]
public sealed class SupportedOSPlatformGuardAttribute : System.Runtime.Versioning.OSPlatformAttribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)>]
type SupportedOSPlatformGuardAttribute = class
    inherit OSPlatformAttribute
Public NotInheritable Class SupportedOSPlatformGuardAttribute
Inherits OSPlatformAttribute
Dziedziczenie
SupportedOSPlatformGuardAttribute
Atrybuty

Uwagi

Obiekt wywołujący może zastosować SupportedOSPlatformGuardAttribute obiekt do pola, właściwości lub metody i używać tego pola, właściwości lub metody w instrukcjach warunkowych lub aserujących w celu bezpiecznego wywoływania interfejsów API specyficznych dla platformy.

         The type of the field or property should be boolean, the method return type should be boolean in order to be used as platform guard.

Konstruktory

SupportedOSPlatformGuardAttribute(String)

Inicjuje nowe wystąpienie klasy atrybutów SupportedOSPlatformGuardAttribute dla określonej obsługiwanej platformy systemu operacyjnego.

Właściwości

PlatformName

Pobiera nazwę i opcjonalną wersję platformy, do którego ma zastosowanie atrybut.

(Odziedziczone po OSPlatformAttribute)
TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego elementu Attribute.

(Odziedziczone po Attribute)

Metody

Equals(Object)

Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi.

(Odziedziczone po Attribute)
GetHashCode()

Zwraca wartość skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
IsDefaultAttribute()

W przypadku zastąpienia w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

W przypadku zastąpienia w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy