Share via


EventMappingSettings 建構函式

定義

初始化 EventMappingSettings 類別的新執行個體。

多載

EventMappingSettings(String, String)

使用指定的名稱和型別來初始化 EventMappingSettings 類別的新執行個體。

EventMappingSettings(String, String, Int32, Int32)

使用指定的值,初始化 BufferModeSettings 類別的新執行個體。

EventMappingSettings(String, String)

使用指定的名稱和型別來初始化 EventMappingSettings 類別的新執行個體。

public:
 EventMappingSettings(System::String ^ name, System::String ^ type);
public EventMappingSettings (string name, string type);
new System.Web.Configuration.EventMappingSettings : string * string -> System.Web.Configuration.EventMappingSettings
Public Sub New (name As String, type As String)

參數

name
String

所建立的 EventMappingSettings 物件名稱。

type
String

要使用之事件類別的完整型別。

範例

下列程式碼範例示範如何使用 建 EventMappingSettings 構函式。 此程式碼範例是針對 類別提供的較大範例的 HealthMonitoringSection 一部分。

// Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings(
    "Failure Audits", "System.Web.Management.WebAuditEvent, System.Web"));
' Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings( _
    "Failure Audits", "System.Web.Management.WebAuditEvent, System.Web"))

備註

下表顯示用於此建構函式的預設設定。

設定 預設值
StartEventCode 0.
EndEventCode MaxValue.

另請參閱

適用於

EventMappingSettings(String, String, Int32, Int32)

使用指定的值,初始化 BufferModeSettings 類別的新執行個體。

public:
 EventMappingSettings(System::String ^ name, System::String ^ type, int startEventCode, int endEventCode);
public EventMappingSettings (string name, string type, int startEventCode, int endEventCode);
new System.Web.Configuration.EventMappingSettings : string * string * int * int -> System.Web.Configuration.EventMappingSettings
Public Sub New (name As String, type As String, startEventCode As Integer, endEventCode As Integer)

參數

name
String

所建立的 EventMappingSettings 物件名稱。

type
String

要使用之事件類別的完整型別。

startEventCode
Int32

開始事件程式碼範圍。

endEventCode
Int32

結束事件程式碼範圍。

範例

下列程式碼範例示範如何使用 建 EventMappingSettings 構函式。 此程式碼範例是針對 類別提供的較大範例的 HealthMonitoringSection 一部分。

// Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings(
    "Success Audits", "System.Web.Management.WebAuditEvent, System.Web",
    512, Int32.MaxValue));
' Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings( _
    "Success Audits", "System.Web.Management.WebAuditEvent, System.Web", _
    512, Int32.MaxValue))

另請參閱

適用於