RuleSettings.MaxLimit 属性

定义

获取或设置引发相同类型事件的最大次数。Gets or sets the maximum number of times events of the same type are raised.

public:
 property int MaxLimit { int get(); void set(int value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.InfiniteIntConverter))]
[System.Configuration.ConfigurationProperty("maxLimit", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.IntegerValidator(MinValue=0)]
public int MaxLimit { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.InfiniteIntConverter))>]
[<System.Configuration.ConfigurationProperty("maxLimit", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.IntegerValidator(MinValue=0)>]
member this.MaxLimit : int with get, set
Public Property MaxLimit As Integer

属性值

Int32

引发相同类型事件的最大次数。The maximum number of times events of the same type are raised. 默认值为 MaxValueThe default value is MaxValue.

属性

示例

下面的代码示例说明如何使用 MaxLimit 属性。The following code example shows how to use the MaxLimit property. 此代码示例是为类提供的更大示例的一部分 HealthMonitoringSectionThis code example is part of a larger example provided for the HealthMonitoringSection class.

ruleSetting.MaxLimit = Int32.MaxValue;
ruleSetting.MaxLimit = Int32.MaxValue

注解

此属性的值必须大于零。This property must have a value greater than zero. 如果保存了配置节,则无效值可能会导致引发异常。Invalid values may cause an exception to be thrown when the configuration section is saved.

这表示将引发相同类型事件的最大次数。This represents the maximum number of times an event of the same type will be raised. 例如,如果值为 10 ,则该事件将引发10次,并在之后被忽略。For example, if the value is 10, then the event will be raised 10 times and ignored thereafter.

适用于

另请参阅