Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TempAssemblyCache.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Xml.Serialization
;
4
5
internal
sealed
class
TempAssemblyCache
6
{
7
private
Dictionary<TempAssemblyCacheKey, TempAssembly>
_cache
=
new
Dictionary<TempAssemblyCacheKey, TempAssembly>
();
8
9
internal
TempAssembly
this
[
string
ns,
object
o
]
10
{
11
get
12
{
13
_cache
.
TryGetValue
(
new
TempAssemblyCacheKey
(ns,
o
),
out
var
value
);
14
return
value
;
15
}
16
}
17
18
internal
void
Add
(
string
ns,
object
o
,
TempAssembly
assembly
)
19
{
20
TempAssemblyCacheKey
key
=
new
TempAssemblyCacheKey
(ns,
o
);
21
lock
(
this
)
22
{
23
if
(!
_cache
.
TryGetValue
(
key
,
out
var
value
) ||
value
!=
assembly
)
24
{
25
Dictionary<TempAssemblyCacheKey, TempAssembly>
dictionary
=
new
Dictionary<TempAssemblyCacheKey, TempAssembly>
(
_cache
);
26
dictionary
[
key
] =
assembly
;
27
_cache
=
dictionary
;
28
}
29
}
30
}
31
}
System.Collections.Generic.Dictionary.TryGetValue
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Definition
Dictionary.cs:1419
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Xml.Serialization.TempAssemblyCacheKey
Definition
TempAssemblyCacheKey.cs:6
System.Xml.Serialization.TempAssemblyCache._cache
Dictionary< TempAssemblyCacheKey, TempAssembly > _cache
Definition
TempAssemblyCache.cs:7
System.Xml.Serialization.TempAssemblyCache.Add
void Add(string ns, object o, TempAssembly assembly)
Definition
TempAssemblyCache.cs:18
System.Xml.Serialization.TempAssemblyCache
Definition
TempAssemblyCache.cs:6
System.Xml.Serialization.TempAssembly
Definition
TempAssembly.cs:15
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Xml.Serialization
Definition
DateTimeSerializationSection.cs:1
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.value
@ value
System.ExceptionArgument.key
@ key
System.ExceptionArgument.dictionary
@ dictionary
source
System.Private.Xml
System.Xml.Serialization
TempAssemblyCache.cs
Generated by
1.10.0