Edit

Bagikan melalui


XmlDictionary.TryLookup Method

Definition

Attempts to look up an entry in the dictionary.

Overloads

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)

Checks the dictionary for a specified XmlDictionaryString.

Remarks

This method avoids throwing an exception if the string is not currently in the dictionary.

TryLookup(Int32, XmlDictionaryString)

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

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

Parameters

key
Int32

Key to look up.

result
XmlDictionaryString

If key is defined, the XmlDictionaryString that is mapped to the key; otherwise null.

Returns

true if key is in the dictionary; otherwise, false.

Implements

Applies to

TryLookup(String, XmlDictionaryString)

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

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

Parameters

value
String

String value being checked for.

result
XmlDictionaryString

The corresponding XmlDictionaryString, if found; otherwise null.

Returns

true if value is in the dictionary; otherwise, false.

Implements

Exceptions

value is null.

Applies to

TryLookup(XmlDictionaryString, XmlDictionaryString)

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

Checks 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

Parameters

value
XmlDictionaryString

The XmlDictionaryString being checked for.

result
XmlDictionaryString

The matching XmlDictionaryString, if found; otherwise, null.

Returns

true if XmlDictionaryString is in the dictionary; otherwise, false.

Implements

Exceptions

value is null.

Applies to