public TryLookup ( string value, |
||
value | string | |
result | ||
리턴 | bool |
public bool TryLookup(string value, out XmlDictionaryString result)
{
if (value == null)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
if (_strings != null)
{
for (int i = 0; i < _strings.Length; i++)
{
XmlDictionaryString s = _strings[i];
if (s != null && s.Value == value)
{
result = s;
return true;
}
}
}
if (_stringDict != null)
{
foreach (XmlDictionaryString s in _stringDict.Values)
{
if (s.Value == value)
{
result = s;
return true;
}
}
}
result = null;
return false;
}
XmlBinaryReaderSession::TryLookup ( System value, System &result ) : bool | |
XmlBinaryReaderSession::TryLookup ( |
|
XmlBinaryReaderSession::TryLookup ( int key, System &result ) : bool | |
XmlBinaryReaderSession::TryLookup ( int key, |
|
XmlBinaryReaderSession::TryLookup ( string value, System &result ) : bool |
public string GetValue(IXmlDictionary staticDictionary, XmlBinaryReaderSession readerSession) { int id = this.DictionaryId / 2; XmlDictionaryString dicString = XmlDictionaryString.Empty; bool found; if (this.IsSession) { if (readerSession == null) { return null; } found = readerSession.TryLookup(id, out dicString); } else { if (staticDictionary == null) { return null; } found = staticDictionary.TryLookup(id, out dicString); } if (found) { return dicString.Value; } else { throw new ArgumentException("Cannot find value for dictionary string with ID = " + this.DictionaryId); } }