SupportedOSPlatformGuardAttribute クラス

定義

サポートされているプラットフォーム名とオプションのバージョンを使用して、カスタム ガード フィールド、プロパティ、またはメソッドに注釈を付けます。 複数の属性を適用して、サポートされている複数のプラットフォームのガードを示すことができます。

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
継承
SupportedOSPlatformGuardAttribute
属性

注釈

呼び出し元は、 をフィールド、プロパティ、またはメソッドに適用 SupportedOSPlatformGuardAttribute し、そのフィールド、プロパティ、またはメソッドを条件付きステートメントまたはアサート ステートメントで使用して、プラットフォーム固有の API を安全に呼び出すことができます。

         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.

コンストラクター

SupportedOSPlatformGuardAttribute(String)

指定したサポート対象の OS プラットフォームの SupportedOSPlatformGuardAttribute 属性クラスの新しいインスタンスを初期化します。

プロパティ

PlatformName

属性が適用されるプラットフォームの名前とバージョン (オプション) を取得します。

(継承元 OSPlatformAttribute)
TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)

メソッド

Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象