Rediger

Del via


RuleSettings Constructors

Definition

Initializes a new instance of the RuleSettings class.

Overloads

RuleSettings(String, String, String)

Initializes a new instance of the RuleSettings class using default settings; however, the name, event name, and provider are specified.

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

Initializes a new instance of the RuleSettings class where all values except those of the Custom class are specified.

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

Initializes a new instance of the BufferModeSettings class where all values are specified.

RuleSettings(String, String, String)

Initializes a new instance of the RuleSettings class using default settings; however, the name, event name, and provider are specified.

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)

Parameters

name
String

The name of the RuleSettings object to create.

eventName
String

The name of the EventMappingSettings object this rule applies to.

provider
String

The name of the ProviderSettings object this rule applies to.

Examples

The following code example shows how to use the RuleSettings constructor. This code example is part of a larger example provided for the HealthMonitoringSection class.

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

Remarks

The following table shows the default settings that are used for this constructor.

Property Default value
Custom An empty string ("").
MaxLimit MaxValue.
MinInstances 1.
MinInterval 0 ticks.
Profile An empty string ("").

See also

Applies to

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

Initializes a new instance of the RuleSettings class where all values except those of the Custom class are specified.

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)

Parameters

name
String

The name of the RuleSettings object to create.

eventName
String

The name of the EventMappingSettings object this rule applies to.

provider
String

The name of the ProviderSettings object this rule applies to.

profile
String

The name of the ProfileSettings object this rule applies to.

minInstances
Int32

The minimum number of occurrences of the same type of event that can occur before the event is raised to the provider.

maxLimit
Int32

The maximum number of times events of the same type can be raised.

minInterval
TimeSpan

The minimum time interval between two events of the same type.

Examples

The following code example shows how to use the RuleSettings constructor. This code example is part of a larger example provided for the HealthMonitoringSection class.

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

Remarks

The following table shows the default settings that are used for this constructor.

Property Default value
Custom An empty string ("").

See also

Applies to

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

Initializes a new instance of the BufferModeSettings class where all values are specified.

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)

Parameters

name
String

The name of the RuleSettings object to create.

eventName
String

The name of the EventMappingSettings object this rule applies to.

provider
String

The name of the ProviderSettings object this rule applies to.

profile
String

The name of the ProfileSettings object this rule applies to.

minInstances
Int32

The minimum number of occurrences of an event of the same type before the event is fired to the provider.

maxLimit
Int32

The maximum number of times events of the same type are fired.

minInterval
TimeSpan

The minimum time interval between two events of the same type.

custom
String

The fully qualified type of a custom class that implements IWebEventCustomEvaluator.

Examples

The following code example shows how to use the RuleSettings constructor. This code example is part of a larger example provided for the HealthMonitoringSection class.

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

Remarks

You must provide every setting for this constructor.

See also

Applies to