语言

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))

另请参阅

适用于