XmlDictionary.TryLookup 方法

定义

尝试在字典中查找项。Attempts to look up an entry in the dictionary.

重载

TryLookup(Int32, XmlDictionaryString)

尝试在字典中查找项。Attempts to look up an entry in the dictionary.

TryLookup(String, XmlDictionaryString)

检查字典中是否有指定的字符串值。Checks the dictionary for a specified string value.

TryLookup(XmlDictionaryString, XmlDictionaryString)

检查字典中是否有指定的 XmlDictionaryStringChecks the dictionary for a specified XmlDictionaryString.

注解

如果字符串当前不在字典中,则此方法可避免引发异常。This method avoids throwing an exception if the string is not currently in the dictionary.

TryLookup(Int32, XmlDictionaryString)

尝试在字典中查找项。Attempts to look up an entry in the dictionary.

public:
 virtual bool TryLookup(int key, [Runtime::InteropServices::Out] System::Xml::XmlDictionaryString ^ % result);
public virtual bool TryLookup (int key, out System.Xml.XmlDictionaryString result);
public virtual bool TryLookup (int key, out System.Xml.XmlDictionaryString? result);
abstract member TryLookup : int * XmlDictionaryString -> bool
override this.TryLookup : int * XmlDictionaryString -> bool
Public Overridable Function TryLookup (key As Integer, ByRef result As XmlDictionaryString) As Boolean

参数

key
Int32

要查找的键。Key to look up.

result
XmlDictionaryString

如果已定义 key,则 XmlDictionaryString 映射到该键;否则为 nullIf key is defined, the XmlDictionaryString that is mapped to the key; otherwise null.

返回

Boolean

如果键在字典中,则为 true;否则为 falsetrue if key is in the dictionary; otherwise, false.

实现

适用于

TryLookup(String, XmlDictionaryString)

检查字典中是否有指定的字符串值。Checks the dictionary for a specified string value.

public:
 virtual bool TryLookup(System::String ^ value, [Runtime::InteropServices::Out] System::Xml::XmlDictionaryString ^ % result);
public virtual bool TryLookup (string value, out System.Xml.XmlDictionaryString result);
public virtual bool TryLookup (string value, out System.Xml.XmlDictionaryString? result);
abstract member TryLookup : string * XmlDictionaryString -> bool
override this.TryLookup : string * XmlDictionaryString -> bool
Public Overridable Function TryLookup (value As String, ByRef result As XmlDictionaryString) As Boolean

参数

value
String

要检查的字符串值。String value being checked for.

result
XmlDictionaryString

如果找到,则为相应的 XmlDictionaryString;否则为 nullThe corresponding XmlDictionaryString, if found; otherwise null.

返回

Boolean

如果值在字典中,则为 true;否则为 falsetrue if value is in the dictionary; otherwise, false.

实现

例外

valuenullvalue is null.

适用于

TryLookup(XmlDictionaryString, XmlDictionaryString)

检查字典中是否有指定的 XmlDictionaryStringChecks the dictionary for a specified XmlDictionaryString.

public:
 virtual bool TryLookup(System::Xml::XmlDictionaryString ^ value, [Runtime::InteropServices::Out] System::Xml::XmlDictionaryString ^ % result);
public virtual bool TryLookup (System.Xml.XmlDictionaryString value, out System.Xml.XmlDictionaryString result);
public virtual bool TryLookup (System.Xml.XmlDictionaryString value, out System.Xml.XmlDictionaryString? result);
abstract member TryLookup : System.Xml.XmlDictionaryString * XmlDictionaryString -> bool
override this.TryLookup : System.Xml.XmlDictionaryString * XmlDictionaryString -> bool
Public Overridable Function TryLookup (value As XmlDictionaryString, ByRef result As XmlDictionaryString) As Boolean

参数

value
XmlDictionaryString

要检查的 XmlDictionaryStringThe XmlDictionaryString being checked for.

result
XmlDictionaryString

如果找到,则为匹配的 XmlDictionaryString;否则为 nullThe matching XmlDictionaryString, if found; otherwise, null.

返回

Boolean

如果 true 在字典中,则为 XmlDictionaryString;否则为 falsetrue if XmlDictionaryString is in the dictionary; otherwise, false.

实现

例外

valuenullvalue is null.

适用于