BindingList<T>.SupportsSearchingCore Eigenschaft


Ruft einen Wert ab, der angibt, ob die Liste Suchvorgänge unterstützt.Gets a value indicating whether the list supports searching.

 virtual property bool SupportsSearchingCore { bool get(); };
protected virtual bool SupportsSearchingCore { get; }
member this.SupportsSearchingCore : bool
Protected Overridable ReadOnly Property SupportsSearchingCore As Boolean



true, wenn Liste Suchvorgänge unterstützt, andernfalls false.true if the list supports searching; otherwise, false. Der Standardwert ist false.The default is false.


Im folgenden Codebeispiel wird die Verwendung des-Elements veranschaulicht SupportsSearchingCore .The following code example demonstrates how to use the SupportsSearchingCore member.

    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;
Public Class MyFontList
    Inherits BindingList(Of Font)

    Protected Overrides ReadOnly Property SupportsSearchingCore() As Boolean
            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


Die- BindingList<T> Klasse stellt keine Basis Implementierung für die Suche bereit, daher wird SupportsSearchingCore standardmäßig immer zurückgegeben false .The BindingList<T> class does not provide a base implementation of searching, so SupportsSearchingCore always returns false by default. Weitere Informationen zum Implementieren von Such Vorgängen finden Sie unter der- IBindingList.Find Methode.For more information about implementing searching, see the IBindingList.Find method.

Gilt für: