RuleSettingsCollection.IndexOf(String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した名前のコレクション内の RuleSettings オブジェクトのインデックスを検索します。
public:
int IndexOf(System::String ^ name);
public int IndexOf(string name);
member this.IndexOf : string -> int
Public Function IndexOf (name As String) As Integer
パラメーター
- name
- String
コレクション内の RuleSettings オブジェクトの名前。
返品
指定した名前を持つコレクション内の RuleSettings オブジェクトのインデックス。
例
次のコード例は、 IndexOf メソッドの使用方法を示しています。 このコード例は、 HealthMonitoringSection クラスに提供されるより大きな例の一部です。
// 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 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"))
注釈
指定した名前の RuleSettings オブジェクトがコレクション内にない場合は、-1 を返します。