ModelMemberCollection<TItemType, TKeyType>.Find 方法 (String, Boolean)

在派生类中重写时,在集合中搜索具有指定键的项,并在找到时将它返回。

命名空间:  Microsoft.Windows.Design.Model
程序集:  Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)

语法

声明
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

参数

  • throwOnError
    类型:System.Boolean
    如果在未找到项时应引发异常,则为 true;否则为 false。

返回值

类型:TItemType
具有指定键的 TItemType。如果未找到,此方法将引发异常或返回 nullnull 引用(在 Visual Basic 中为 Nothing),具体取决于传递给 throwOnError 的值。

异常

异常 条件
ArgumentException

找不到 name,并且 throwOnError 为 true。

.NET Framework 安全性

请参见

参考

ModelMemberCollection<TItemType, TKeyType> 类

Find 重载

Microsoft.Windows.Design.Model 命名空间

其他资源

WPF 设计器扩展性