語言

RuleSettings 建構函式

定義

初始化 RuleSettings 類別的新執行個體。

多載

名稱 Description
RuleSettings(String, String, String)

使用預設設定初始化該類別的新實例 RuleSettings ;但名稱、事件名稱及提供者皆有指定。

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan)

初始化一個類別的新實例 RuleSettings ,並指定除類別 Custom 值外的所有值。

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan, String)

初始化一個類別的新實例 BufferModeSettings ,所有值皆已指定。

RuleSettings(String, String, String)

使用預設設定初始化該類別的新實例 RuleSettings ;但名稱、事件名稱及提供者皆有指定。

public:
 RuleSettings(System::String ^ name, System::String ^ eventName, System::String ^ provider);
public RuleSettings(string name, string eventName, string provider);
new System.Web.Configuration.RuleSettings : string * string * string -> System.Web.Configuration.RuleSettings
Public Sub New (name As String, eventName As String, provider As String)

參數

name
String

要創造的物件名稱 RuleSettings 。

eventName
String

此規則適用於物件名稱 EventMappingSettings 。

provider
String

此規則適用於物件名稱 ProviderSettings 。

範例

以下程式碼範例展示了如何使用 RuleSettings 建構子。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", 
    "All Errors", "EventLogProvider"));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", _
    "All Errors", "EventLogProvider"))

備註

下表顯示此建構子所使用的預設設定。

房產 預設值
Custom 一個空字串(“”)。
MaxLimit MaxValue。
MinInstances 1.
MinInterval 0刻。
Profile 一個空字串(“”)。

另請參閱

適用於

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan)

初始化一個類別的新實例 RuleSettings ,並指定除類別 Custom 值外的所有值。

public:
 RuleSettings(System::String ^ name, System::String ^ eventName, System::String ^ provider, System::String ^ profile, int minInstances, int maxLimit, TimeSpan minInterval);
public RuleSettings(string name, string eventName, string provider, string profile, int minInstances, int maxLimit, TimeSpan minInterval);
new System.Web.Configuration.RuleSettings : string * string * string * string * int * int * TimeSpan -> System.Web.Configuration.RuleSettings
Public Sub New (name As String, eventName As String, provider As String, profile As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan)

參數

name
String

要創造的物件名稱 RuleSettings 。

eventName
String

此規則適用於物件名稱 EventMappingSettings 。

provider
String

此規則適用於物件名稱 ProviderSettings 。

profile
String

此規則適用於物件名稱 ProfileSettings 。

minInstances
Int32

同類型事件發生的最低次數,該事件才會被反映給醫療提供者。

maxLimit
Int32

同類型事件最多可被提出的次數。

minInterval
TimeSpan

同類型事件發生的最小時間間隔。

範例

以下程式碼範例展示了如何使用 RuleSettings 建構子。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default",
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0)));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default", _
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0)))

備註

下表顯示此建構子所使用的預設設定。

房產 預設值
Custom 一個空字串(“”)。

另請參閱

適用於

RuleSettings(String, String, String, String, Int32, Int32, TimeSpan, String)

初始化一個類別的新實例 BufferModeSettings ,所有值皆已指定。

public:
 RuleSettings(System::String ^ name, System::String ^ eventName, System::String ^ provider, System::String ^ profile, int minInstances, int maxLimit, TimeSpan minInterval, System::String ^ custom);
public RuleSettings(string name, string eventName, string provider, string profile, int minInstances, int maxLimit, TimeSpan minInterval, string custom);
new System.Web.Configuration.RuleSettings : string * string * string * string * int * int * TimeSpan * string -> System.Web.Configuration.RuleSettings
Public Sub New (name As String, eventName As String, provider As String, profile As String, minInstances As Integer, maxLimit As Integer, minInterval As TimeSpan, custom As String)

參數

name
String

要創造的物件名稱 RuleSettings 。

eventName
String

此規則適用於物件名稱 EventMappingSettings 。

provider
String

此規則適用於物件名稱 ProviderSettings 。

profile
String

此規則適用於物件名稱 ProfileSettings 。

minInstances
Int32

在事件被觸發給提供者之前,同類型事件發生的最少次數。

maxLimit
Int32

同類型事件發生的最大次數。

minInterval
TimeSpan

同類型事件發生的最小時間間隔。

custom
String

這是一套完整合格的自訂類別,實作 IWebEventCustomEvaluator了 。

範例

以下程式碼範例展示了如何使用 RuleSettings 建構子。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom",
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"));
' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom", _
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"))

備註

你必須為這個建構器提供所有設定。

另請參閱

適用於