ExperimentalAttribute 類別

定義

表示 API 是實驗性的,而且未來可能會變更。

public ref class ExperimentalAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed class ExperimentalAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)>]
type ExperimentalAttribute = class
    inherit Attribute
Public NotInheritable Class ExperimentalAttribute
Inherits Attribute
繼承
ExperimentalAttribute
屬性

備註

ExperimentalAttribute 允許呼叫地點以診斷標記,表示使用了實驗性功能。 你可以用這個屬性在其他穩定函式庫中發佈預覽功能。

欲了解更多關於將 API 標記為預覽的資訊,請參閱預覽 API。

建構函式

名稱 Description
ExperimentalAttribute(String)

初始化該類別的新實例 ExperimentalAttribute ,指定編譯器在回報該屬性所適用的 API 使用時所使用的 ID。

屬性

名稱 Description
DiagnosticId

取得編譯器在回報該屬性所適用的 API 使用時會使用的 ID。

Message

取得或設定與實驗屬性相關的可選訊息。

TypeId

在衍生類別中實作時,取得這個 Attribute的唯一標識碼。

(繼承來源 Attribute)
UrlFormat

取得或設定對應文件的網址。 API 接受格式字串而非實際 URL,建立包含診斷 ID 的通用 URL。

方法

名稱 Description
Equals(Object)

傳回值,這個值表示這個實例是否等於指定的物件。

(繼承來源 Attribute)
GetHashCode()

傳回這個實例的哈希碼。

(繼承來源 Attribute)
GetType()

取得目前實例的 Type

(繼承來源 Object)
IsDefaultAttribute()

在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

適用於

另請參閱