Share via


RuleSettings.MaxLimit 屬性

定義

取得或設定引發相同型別事件的最多次數。

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

屬性值

相同型別事件引發的最多次數。 預設值為 Int32.MaxValue

屬性

範例

下列程式碼範例示範如何使用 MaxLimit 屬性。 此程式碼範例是針對 類別提供的較大範例的 HealthMonitoringSection 一部分。

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

備註

這個屬性的值必須大於零。 不正確值可能會在儲存組態區段時擲回例外狀況。

這代表將引發相同類型之事件的最大次數。 例如,如果值為 10 ,則事件將會引發 10 次,並在之後予以忽略。

適用於

另請參閱