Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryGetVariable()

bool System.Xml.Serialization.CodeGenerator.TryGetVariable ( string name,
[NotNullWhen(true)] out object variable )
inlinepackage

Definition at line 282 of file CodeGenerator.cs.

283 {
284 if (_currentScope != null && _currentScope.TryGetValue(name, out var value))
285 {
286 variable = value;
287 return true;
288 }
289 if (_argList != null && _argList.TryGetValue(name, out var value2))
290 {
292 return true;
293 }
294 if (int.TryParse(name, out var result))
295 {
296 variable = result;
297 return true;
298 }
299 variable = null;
300 return false;
301 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Dictionary< string, ArgBuilder > _argList
bool TryGetValue(string key, [NotNullWhen(true)] out LocalBuilder value)
Definition LocalScope.cs:38

References System.Xml.Serialization.CodeGenerator._argList, System.Xml.Serialization.CodeGenerator._currentScope, System.Xml.Dictionary, System.Xml.Serialization.LocalScope.TryGetValue(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Xml.Serialization.CodeGenerator.GetVariable(), System.Xml.Serialization.XmlSerializationReaderILGen.WriteSourceBegin(), and System.Xml.Serialization.XmlSerializationReaderILGen.WriteSourceEnd().