RuleSettings 构造函数

定义

初始化 RuleSettings 类的新实例。

重载

名称 说明
RuleSettings(String, String, String)

使用默认设置初始化类的新实例 RuleSettings ;但是,指定了名称、事件名称和提供程序。

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan)

初始化类的新实例 RuleSettings ,其中除指定类以外的所有值 Custom

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan, String)

初始化指定所有值的类的新实例 BufferModeSettings

RuleSettings(String, String, String)

使用默认设置初始化类的新实例 RuleSettings ;但是,指定了名称、事件名称和提供程序。

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

参数

name
String

要创建的对象的名称 RuleSettings

eventName
String

此规则适用的对象的名称 EventMappingSettings

provider
String

此规则适用的对象的名称 ProviderSettings

示例

下面的代码示例演示如何使用 RuleSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", 
    "All Errors", "EventLogProvider"));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", _
    "All Errors", "EventLogProvider"))

注解

下表显示了用于此构造函数的默认设置。

财产 默认值
Custom 空字符串(“)。
MaxLimit MaxValue
MinInstances 1.
MinInterval 0 滴答声。
Profile 空字符串(“)。

另请参阅

适用于

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan)

初始化类的新实例 RuleSettings ,其中除指定类以外的所有值 Custom

public:
 RuleSettings(System::String ^ name, System::String ^ eventName, System::String ^ provider, System::String ^ profile, int minInstances, int maxLimit, TimeSpan minInterval);
public RuleSettings(string name, string eventName, string provider, string profile, int minInstances, int maxLimit, TimeSpan minInterval);
new System.Web.Configuration.RuleSettings : string * string * string * string * int * int * TimeSpan -> System.Web.Configuration.RuleSettings
Public Sub New (name As String, eventName As String, provider As String, profile As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan)

参数

name
String

要创建的对象的名称 RuleSettings

eventName
String

此规则适用的对象的名称 EventMappingSettings

provider
String

此规则适用的对象的名称 ProviderSettings

profile
String

此规则适用的对象的名称 ProfileSettings

minInstances
Int32

在将事件引发到提供程序之前可能发生的相同类型的事件的最小出现次数。

maxLimit
Int32

可以引发同一类型的事件的最大次数。

minInterval
TimeSpan

同一类型的两个事件之间的最小时间间隔。

示例

下面的代码示例演示如何使用 RuleSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default",
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0)));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default", _
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0)))

注解

下表显示了用于此构造函数的默认设置。

财产 默认值
Custom 空字符串(“)。

另请参阅

适用于

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan, String)

初始化指定所有值的类的新实例 BufferModeSettings

public:
 RuleSettings(System::String ^ name, System::String ^ eventName, System::String ^ provider, System::String ^ profile, int minInstances, int maxLimit, TimeSpan minInterval, System::String ^ custom);
public RuleSettings(string name, string eventName, string provider, string profile, int minInstances, int maxLimit, TimeSpan minInterval, string custom);
new System.Web.Configuration.RuleSettings : string * string * string * string * int * int * TimeSpan * string -> System.Web.Configuration.RuleSettings
Public Sub New (name As String, eventName As String, provider As String, profile As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan, custom As String)

参数

name
String

要创建的对象的名称 RuleSettings

eventName
String

此规则适用的对象的名称 EventMappingSettings

provider
String

此规则适用的对象的名称 ProviderSettings

profile
String

此规则适用的对象的名称 ProfileSettings

minInstances
Int32

在向提供程序触发事件之前,相同类型的事件的最小出现次数。

maxLimit
Int32

触发同一类型的事件的最大次数。

minInterval
TimeSpan

同一类型的两个事件之间的最小时间间隔。

custom
String

实现 IWebEventCustomEvaluator的自定义类的完全限定类型。

示例

下面的代码示例演示如何使用 RuleSettings 构造函数。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom",
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom", _
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"))

注解

必须为此构造函数提供每个设置。

另请参阅

适用于