XmlDictionary.TryLookup 方法

定义

尝试在字典中查找项。

重载

TryLookup(Int32, XmlDictionaryString)

尝试在字典中查找项。

TryLookup(String, XmlDictionaryString)

检查字典中是否有指定的字符串值。

TryLookup(XmlDictionaryString, XmlDictionaryString)

检查字典中是否有指定的 XmlDictionaryString

注解

如果字符串当前不在字典中,则此方法可避免引发异常。

TryLookup(Int32, XmlDictionaryString)

Source:
XmlDictionary.cs
Source:
XmlDictionary.cs
Source:
XmlDictionary.cs

尝试在字典中查找项。

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

要查找的键。

result
XmlDictionaryString

如果已定义 key,则 XmlDictionaryString 映射到该键;否则为 null

返回

如果键在字典中,则为 true;否则为 false

实现

适用于

TryLookup(String, XmlDictionaryString)

Source:
XmlDictionary.cs
Source:
XmlDictionary.cs
Source:
XmlDictionary.cs

检查字典中是否有指定的字符串值。

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

要检查的字符串值。

result
XmlDictionaryString

如果找到,则为相应的 XmlDictionaryString;否则为 null

返回

如果值在字典中,则为 true;否则为 false

实现

例外

valuenull

适用于

TryLookup(XmlDictionaryString, XmlDictionaryString)

Source:
XmlDictionary.cs
Source:
XmlDictionary.cs
Source:
XmlDictionary.cs

检查字典中是否有指定的 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

参数

result
XmlDictionaryString

如果找到,则为匹配的 XmlDictionaryString;否则为 null

返回

如果 true 在字典中,则为 XmlDictionaryString;否则为 false

实现

例外

valuenull

适用于