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)

適用対象