ProfileSettings.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
属性值
引发相同类型事件的最大次数。The maximum number of times events of the same type are raised. 默认值为 MaxValue。The default is MaxValue.
- 属性
示例
下面的代码示例说明如何使用 MaxLimit 属性。The following code example shows how to use the MaxLimit property. 此代码示例是为类提供的更大示例的一部分 HealthMonitoringSection 。This code example is part of a larger example provided for the HealthMonitoringSection class.
profileSetting.MaxLimit = Int32.MaxValue;
profileSetting.MaxLimit = Int32.MaxValue
注解
此属性的值必须大于零。This property must have a value greater than zero. 通过将该值设置为,可以使其成为无限值 MaxValue 。The value can be made infinite by setting it to MaxValue. 如果保存了配置节,则无效值可能会导致引发异常。Invalid values may cause an exception to be thrown when the configuration section is saved.
此属性指定将引发相同类型事件的最大次数。This property specifies the maximum number of times an event of the same type will be raised. 例如,如果值为 10 ,则该事件将引发10次,并在之后被忽略。For example if the value is 10, the event will be raised 10 times and ignored thereafter.