HealthMonitoringSection.Rules プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HealthMonitoringSection.Rules プロパティの意味・解説 

HealthMonitoringSection.Rules プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

RuleSettings オブジェクトの RuleSettingsCollection コレクション取得します

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public ReadOnly Property
 Rules As RuleSettingsCollection
Dim instance As HealthMonitoringSection
Dim value As RuleSettingsCollection

value = instance.Rules
public RuleSettingsCollection Rules { get;
 }
public:
property RuleSettingsCollection^ Rules {
    RuleSettingsCollection^ get ();
}
/** @property */
public RuleSettingsCollection get_Rules ()
public function get Rules
 () : RuleSettingsCollection

プロパティ
RuleSettingsCollection コレクション既定値は空の RuleSettingsCollection コレクションです。

解説解説

RuleSettings オブジェクトは、EventMappings プロパティ定義されているイベントと Providers プロパティ定義されているイベント プロバイダとの間の接続定義します

使用例使用例

Rules プロパティ使用方法コード例次に示します。このコード例は、HealthMonitoringSection クラストピック取り上げているコード例一部分です。

' Add a RuleSettings object to the Rules collection property.
Dim ruleSetting As RuleSettings = new
 RuleSettings("All Errors Default", _
    "All Errors", "EventLogProvider")
ruleSetting.Name = "All Errors Custom"
ruleSetting.EventName = "All Errors"
ruleSetting.Provider = "EventLogProvider"
ruleSetting.Profile = "Custom"
ruleSetting.MaxLimit = Int32.MaxValue
ruleSetting.MinInstances = 1
ruleSetting.MinInterval = TimeSpan.Parse("00:00:30")
ruleSetting.Custom = "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"
healthMonitoringSection.Rules.Add(ruleSetting)

' 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("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 Custom", _
    "Failure Audits", "EventLogProvider",
 "Custom", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2,
 MyCustom.dll"))

' Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1, _
    new RuleSettings("All Errors Default2",
 _
        "All Errors", "EventLogProvider"))

' Display contents of the Rules collection property
Console.WriteLine( _
    "Rules Collection contains {0} values:", healthMonitoringSection.Rules.Count)

' Display all elements.
For i As System.Int32 = 0 To
 healthMonitoringSection.Rules.Count -1
ruleSetting = healthMonitoringSection.Rules(i)
Dim name As String = ruleSetting.Name
Dim eventName As String
 = ruleSetting.EventName
Dim provider As String =
 ruleSetting.Provider
Dim profile As String =
 ruleSetting.Profile
Dim minInstances As Integer
 = ruleSetting.MinInstances
Dim maxLimit As Integer
 = ruleSetting.MaxLimit
Dim minInterval As TimeSpan = ruleSetting.MinInterval
Dim custom As String = ruleSetting.Custom
    Dim item As String =
 "Name='" & name & "', EventName='" &
 eventName & _
        "', Provider =  '" & provider & "', Profile
 =  '" & profile & _
        "', MinInstances =  '" & minInstances & "',
 MaxLimit =  '" & maxLimit & _
        "', MinInterval =  '" & minInterval.ToString()
 & "', Custom =  '" & custom & "'"
    Console.WriteLine("  Item {0}: {1}", i, item)
Next

' See if the Rules collection property contains the RuleSettings 'All
 Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default':
 {0}.", _
    healthMonitoringSection.Rules.Contains("All Errors Default"))

' Get the index of the 'All Errors Default' RuleSettings in the Rules
 collection property.
Console.WriteLine("EventMappings index for 'All
 Errors Default': {0}.", _
    healthMonitoringSection.Rules.IndexOf("All Errors Default"))

' Get a named RuleSettings
ruleSetting = healthMonitoringSection.Rules("All Errors Default")

' Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Remove("All Errors Default")

' Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.RemoveAt(0)

' Clear all RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Clear()

// Add a RuleSettings object to the Rules collection property.
RuleSettings ruleSetting = new RuleSettings("All Errors Default"
,
    "All Errors", "EventLogProvider");
ruleSetting.Name = "All Errors Custom";
ruleSetting.EventName = "All Errors";
ruleSetting.Provider = "EventLogProvider";
ruleSetting.Profile = "Custom";
ruleSetting.MaxLimit = Int32.MaxValue;
ruleSetting.MinInstances = 1;
ruleSetting.MinInterval = TimeSpan.Parse("00:00:30");
ruleSetting.Custom = "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll";
healthMonitoringSection.Rules.Add(ruleSetting);

// 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("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 Custom",
    "Failure Audits", "EventLogProvider", "Custom",
 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2,
 MyCustom.dll"));

// Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1,
    new RuleSettings("All Errors Default2",
        "All Errors", "EventLogProvider"));

// Display contents of the Rules collection property
Console.WriteLine(
    "Rules Collection contains {0} values:", healthMonitoringSection.Rules.Count);

// Display all elements.
for (System.Int32 i = 0; i < healthMonitoringSection.Rules.Count;
 i++)
{
ruleSetting = healthMonitoringSection.Rules[i];
string name = ruleSetting.Name;
string eventName = ruleSetting.EventName;
string provider = ruleSetting.Provider;
string profile = ruleSetting.Profile;
int minInstances = ruleSetting.MinInstances;
int maxLimit = ruleSetting.MaxLimit;
TimeSpan minInterval = ruleSetting.MinInterval;
string custom = ruleSetting.Custom;
    string item = "Name='" + name + "', EventName='"
 + eventName +
        "', Provider =  '" + provider + "', Profile =  '" + profile
 +
        "', MinInstances =  '" + minInstances + "', MaxLimit =  '"
 + maxLimit +
        "', MinInterval =  '" + minInterval + "', Custom =  '"
 + custom + "'";
    Console.WriteLine("  Item {0}: {1}", i, item);
}

// See if the Rules collection property contains the RuleSettings 'All
 Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.",
    healthMonitoringSection.Rules.Contains("All Errors Default"));

// Get the index of the 'All Errors Default' RuleSettings in the Rules
 collection property.
Console.WriteLine("EventMappings index for 'All Errors Default':
 {0}.",
    healthMonitoringSection.Rules.IndexOf("All Errors Default"));

// Get a named RuleSettings
ruleSetting = healthMonitoringSection.Rules["All Errors Default"];

// Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Remove("All Errors Default");

// Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.RemoveAt(0);

// Clear all RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Clear();

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HealthMonitoringSection クラス
HealthMonitoringSection メンバ
System.Web.Configuration 名前空間
RuleSettingsCollection
RuleSettings


このページでは「.NET Framework クラス ライブラリ リファレンス」からHealthMonitoringSection.Rules プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHealthMonitoringSection.Rules プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHealthMonitoringSection.Rules プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HealthMonitoringSection.Rules プロパティ」の関連用語

HealthMonitoringSection.Rules プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HealthMonitoringSection.Rules プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS