IBindingList.SupportsSearching-Eigenschaft
Ruft ab, ob die Liste die Suche mit der Find-Methode unterstützt.
Namespace: System.ComponentModel
Assembly: System (in system.dll)
Syntax
'Declaration
ReadOnly Property SupportsSearching As Boolean
'Usage
Dim instance As IBindingList
Dim value As Boolean
value = instance.SupportsSearching
bool SupportsSearching { get; }
property bool SupportsSearching {
bool get ();
}
/** @property */
boolean get_SupportsSearching ()
function get SupportsSearching () : boolean
Eigenschaftenwert
true, wenn die Liste die Suche mit der Find-Methode unterstützt, andernfalls false.
Beispiel
Im folgenden Codebeispiel wird das Implementieren der SupportsSearching-Eigenschaft veranschaulicht.
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;
}
}
}
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0
Siehe auch
Referenz
IBindingList-Schnittstelle
IBindingList-Member
System.ComponentModel-Namespace