BindingList.FindCore メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > BindingList.FindCore メソッドの意味・解説 

BindingList.FindCore メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

検索派生クラス実装されている場合指定した値の指定したプロパティ記述子を持つ項目のインデックス検索します実装されていない場合は NotSupportedException がスローさます。

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

Protected Overridable Function
 FindCore ( _
    prop As PropertyDescriptor, _
    key As Object _
) As Integer
Dim prop As PropertyDescriptor
Dim key As Object
Dim returnValue As Integer

returnValue = Me.FindCore(prop, key)
protected virtual int FindCore (
    PropertyDescriptor prop,
    Object key
)
protected:
virtual int FindCore (
    PropertyDescriptor^ prop, 
    Object^ key
)
protected int FindCore (
    PropertyDescriptor prop, 
    Object key
)
protected function FindCore (
    prop : PropertyDescriptor, 
    key : Object
) : int

パラメータ

prop

検索対象の PropertyDescriptor。

key

検索条件として使用する property の値。

戻り値
プロパティ記述子一致し指定した値を格納している項目の 0 から始まるインデックス

例外例外
例外種類条件

NotSupportedException

FindCore は、派生クラスオーバーライドされません。

解説解説

BindingList クラス検索基本実装提供していないため、既定では、FindCore は常に NotSupportedExceptionスローます。検索有効にするには、BindingList から派生して次のタスク実行します

使用例使用例

FindCore メンバ使用方法次のコード例示します

Public Class MyFontList
    Inherits BindingList(Of Font)

    Protected Overrides ReadOnly
 Property SupportsSearchingCore() As Boolean
        Get
            Return True
        End Get
    End Property
    
    Protected Overrides Function
 FindCore(ByVal prop As PropertyDescriptor,
 _
        ByVal key As Object)
 As Integer
        ' Ignore the prop value and search by family name.
        Dim i As Integer
        While i < Count
            If Items(i).FontFamily.Name.ToLower() = CStr(key).ToLower()
 Then
                Return i
            End If
            i += 1
        End While

        Return -1
    End Function
End Class
    public class MyFontList : BindingList<Font>
    {

        protected override bool SupportsSearchingCore
        {
            get { return true;
 }
        }
        protected override int FindCore(PropertyDescriptor
 prop, object key)
        {
            // Ignore the prop value and search by family name.
            for (int i = 0; i < Count; ++i)
            {
                if (Items[i].FontFamily.Name.ToLower() == ((string)key).ToLower())
                    return i;

            }
            return -1;
        }


    }
  
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

BindingList.FindCore メソッドのお隣キーワード
検索ランキング

   

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



BindingList.FindCore メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS