EventMappingSettings 构造函数

定义

初始化 EventMappingSettings 类的新实例。Initializes a new instance of the EventMappingSettings class.

重载

EventMappingSettings(String, String)

使用指定的名称和类型初始化 EventMappingSettings 类的新实例。Initializes a new instance of the EventMappingSettings class using the specified name and type.

EventMappingSettings(String, String, Int32, Int32)

使用指定的值初始化 BufferModeSettings 类的新实例。Initializes a new instance of the BufferModeSettings class using the specified values.

EventMappingSettings(String, String)

使用指定的名称和类型初始化 EventMappingSettings 类的新实例。Initializes a new instance of the EventMappingSettings class using the specified name and type.

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 对象的名称。The name of the EventMappingSettings object being created.

type
String

要使用的事件类的完全限定类型。The fully qualified type of the event class to use.

示例

下面的代码示例演示如何使用 EventMappingSettings 构造函数。The following code example shows how to use the EventMappingSettings constructor. 此代码示例是为类提供的更大示例的一部分 HealthMonitoringSectionThis code example is part of a larger example provided for the HealthMonitoringSection class.

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

注解

下表显示了用于此构造函数的默认设置。The following table shows the default settings that are used for this constructor.

设置Setting 默认值Default Value
StartEventCode 0。0.
EndEventCode MaxValue.MaxValue.

另请参阅

适用于

EventMappingSettings(String, String, Int32, Int32)

使用指定的值初始化 BufferModeSettings 类的新实例。Initializes a new instance of the BufferModeSettings class using the specified values.

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 对象的名称。The name of the EventMappingSettings object being created.

type
String

要使用的事件类的完全限定类型。The fully qualified type of the event class to use.

startEventCode
Int32

开始事件代码范围。The starting event code range.

endEventCode
Int32

结束事件代码范围。The ending event code range.

示例

下面的代码示例演示如何使用 EventMappingSettings 构造函数。The following code example shows how to use the EventMappingSettings constructor. 此代码示例是为类提供的更大示例的一部分 HealthMonitoringSectionThis code example is part of a larger example provided for the HealthMonitoringSection class.

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

另请参阅

适用于