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

另请参阅

适用于