แก้ไข

แชร์ผ่าน


ModelMemberCollection<TItemType,TFindType>.Find Method

Definition

Searches the collection for the given key and returns it if it is found.

Overloads

Find(String)

Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null.

Find(TFindType)

Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null.

Find(String, Boolean)

When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null, depending on the value passed to throwOnError.

Find(TFindType, Boolean)

When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null, depending on the value passed to throwOnError.

Find(String)

Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null.

public:
 TItemType Find(System::String ^ name);
public TItemType Find (string name);
member this.Find : string -> 'ItemType
Public Function Find (name As String) As TItemType

Parameters

name
String

The name of the given key.

Returns

TItemType

If found, returns the item.

Exceptions

The name is null.

Applies to

Find(TFindType)

Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null.

public:
 TItemType Find(TFindType value);
public TItemType Find (TFindType value);
member this.Find : 'FindType -> 'ItemType
Public Function Find (value As TFindType) As TItemType

Parameters

value
TFindType

The type of the given key.

Returns

TItemType

If found, returns the item.

Exceptions

The value is null.

Applies to

Find(String, Boolean)

When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null, depending on the value passed to throwOnError.

protected:
 abstract TItemType Find(System::String ^ name, bool throwOnError);
protected abstract TItemType Find (string name, bool throwOnError);
abstract member Find : string * bool -> 'ItemType
Protected MustOverride Function Find (name As String, throwOnError As Boolean) As TItemType

Parameters

name
String

The name of the given key.

throwOnError
Boolean

true to throw an exception if the given key is not found; otherwise, false.

Returns

TItemType

If found, returns the item.

Exceptions

The name is not found and throwOnError is true.

Applies to

Find(TFindType, Boolean)

When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null, depending on the value passed to throwOnError.

protected:
 abstract TItemType Find(TFindType value, bool throwOnError);
protected abstract TItemType Find (TFindType value, bool throwOnError);
abstract member Find : 'FindType * bool -> 'ItemType
Protected MustOverride Function Find (value As TFindType, throwOnError As Boolean) As TItemType

Parameters

value
TFindType

The type of the given key.

throwOnError
Boolean

true to throw an exception if the given key is not found; otherwise, false.

Returns

TItemType

If found, returns the item.

Exceptions

The value is not found and throwOnError is true.

Applies to