ProfileSettings.MinInstances 属性

定义

获取或设置事件在其引发到提供程序前所出现的最少次数。Gets or sets the minimum number of event occurrences before the event is raised to the provider.

public:
 property int MinInstances { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("minInstances", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.IntegerValidator(MinValue=1)]
public int MinInstances { get; set; }
[<System.Configuration.ConfigurationProperty("minInstances", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.IntegerValidator(MinValue=1)>]
member this.MinInstances : int with get, set
Public Property MinInstances As Integer

属性值

Int32

事件在其激发到提供程序前所出现的最少次数。The minimum number of event occurrences before the event is fired to the provider. 默认值为 1The default is 1.

属性

示例

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

profileSetting.MinInstances = 1;
profileSetting.MinInstances = 1

注解

此属性的值必须大于零。This property must have a value greater than zero. 通过将该值设置为,可以使其成为无限值 MaxValueThe 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 minimum number of times an event occurs before an event is raised to the provider. 例如,如果值为,则 5 表示在发生事件的第五个实例之前,ASP.NET 不会将事件引发到提供程序。For example, a value of 5 means that ASP.NET will not raise an event to the provider until the fifth instance of the event occurs. 如果值为无限 (MaxValue) ,则不会将任何事件引发到提供程序。If the value is infinite (MaxValue), then no event will be raised to the provider.

适用于

另请参阅