EventMappingSettings.Type 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定自訂事件類型。
public:
property System::String ^ Type { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("type", DefaultValue="", IsRequired=true)]
public string Type { get; set; }
[<System.Configuration.ConfigurationProperty("type", DefaultValue="", IsRequired=true)>]
member this.Type : string with get, set
Public Property Type As String
屬性值
一個有效的型別參考或空字串(“”)。 預設值是空字串。
- 屬性
範例
以下程式碼範例說明如何使用該 Type 屬性。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。
eventMappingSetting.Type =
"System.Web.Management.WebErrorEvent, System.Web";
eventMappingSetting.Type = _
"System.Web.Management.WebErrorEvent, System.Web"
備註
使用此屬性來指定事件類型。 指定的類型可以是實際的類別類型,也可以是事件類別的父類型。 若為空字串(「」),則不會映射事件, EventMappingSettings 物件作為佔位符。
型別參考的形成方式如下(括號內的項目不需): 命名空間。Typename、 Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z]。 例如「ExampleNameSpace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%”