ProfileSettings.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 的一部分。

profileSetting.MaxLimit = Int32.MaxValue;
profileSetting.MaxLimit = Int32.MaxValue

備註

此性質必須大於零。 可透過將 設定為 MaxValue,使值無限大。 若值無效,則在儲存設定區段時可能會拋出異常。

此性質指定了相同類型事件最多可被觸發的次數。 例如,若值為 10,事件會被提高 10 次,之後被忽略。

適用於

另請參閱