ItemCollection.TryGetItem 方法

定义

通过使用此项集合中的指定标识返回强类型项。

重载

名称 说明
TryGetItem<T>(String, T)

通过使用此项集合中的指定标识返回强类型 GlobalItem 对象。

TryGetItem<T>(String, Boolean, T)

通过使用此项集合中的指定标识返回强类型 GlobalItem 对象。

TryGetItem<T>(String, T)

通过使用此项集合中的指定标识返回强类型 GlobalItem 对象。

public:
generic <typename T>
 where T : System::Data::Metadata::Edm::GlobalItem bool TryGetItem(System::String ^ identity, [Runtime::InteropServices::Out] T % item);
public bool TryGetItem<T>(string identity, out T item) where T : System.Data.Metadata.Edm.GlobalItem;
member this.TryGetItem : string * 'T -> bool (requires 'T :> System.Data.Metadata.Edm.GlobalItem)
Public Function TryGetItem(Of T As GlobalItem) (identity As String, ByRef item As T) As Boolean

类型参数

T

方法返回的类型。

参数

identity
String

项的标识。

item
T

此方法返回时,输出参数包含一个 GlobalItem 对象。 如果项集合中没有具有指定标识的全局项,则此输出参数包含 null。

返回

true 如果存在与搜索条件匹配的项,则为否则,为 false.

适用于

TryGetItem<T>(String, Boolean, T)

通过使用此项集合中的指定标识返回强类型 GlobalItem 对象。

public:
generic <typename T>
 where T : System::Data::Metadata::Edm::GlobalItem bool TryGetItem(System::String ^ identity, bool ignoreCase, [Runtime::InteropServices::Out] T % item);
public bool TryGetItem<T>(string identity, bool ignoreCase, out T item) where T : System.Data.Metadata.Edm.GlobalItem;
member this.TryGetItem : string * bool * 'T -> bool (requires 'T :> System.Data.Metadata.Edm.GlobalItem)
Public Function TryGetItem(Of T As GlobalItem) (identity As String, ignoreCase As Boolean, ByRef item As T) As Boolean

类型参数

T

方法返回的类型。

参数

identity
String

项的标识。

ignoreCase
Boolean

true 执行不区分大小写的搜索;否则,为 false.

item
T

此方法返回时,输出参数包含一个 GlobalItem 对象。 如果项集合中没有具有指定标识的全局项,则此输出参数包含 null。

返回

true 如果存在与搜索条件匹配的项,则为否则,为 false.

适用于