ModelMemberCollection<TItemType, TKeyType>.Find Method (String, Boolean)
When overridden in a derived class, searches the collection for an item with the specified key and returns it if it is found.
Namespace: Microsoft.Windows.Design.Model
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Protected MustOverride Function Find ( _
name As String, _
throwOnError As Boolean _
) As TItemType
protected abstract TItemType Find(
string name,
bool throwOnError
)
protected:
virtual TItemType Find(
String^ name,
bool throwOnError
) abstract
abstract Find :
name:string *
throwOnError:bool -> 'TItemType
protected abstract function Find(
name : String,
throwOnError : boolean
) : TItemType
Parameters
- name
Type: System.String
The key of the item to find.
- throwOnError
Type: System.Boolean
true if an exception should be thrown if the item is not found; otherwise, false.
Return Value
Type: TItemType
A TItemType with the specified key. If not found, this method throws an exception or returns nulla null reference (Nothing in Visual Basic), depending on the value passed to throwOnError.
Exceptions
Exception | Condition |
---|---|
ArgumentException | name is not found and throwOnError is true. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
ModelMemberCollection<TItemType, TKeyType> Class
Microsoft.Windows.Design.Model Namespace