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

◆ GetXmlSerializer() [2/2]

static XmlSerializer System.Data.Common.ObjectStorage.GetXmlSerializer ( Type type,
XmlRootAttribute attribute )
inlinestaticpackage

Definition at line 585 of file ObjectStorage.cs.

586 {
587 XmlSerializer value = null;
590 if (dictionary == null || !dictionary.TryGetValue(key, out value))
591 {
593 {
595 if (dictionary == null || !dictionary.TryGetValue(key, out value))
596 {
598 if (dictionary != null)
599 {
602 {
603 dictionary2.Add(item.Key, item.Value);
604 }
606 }
607 else
608 {
609 dictionary = new Dictionary<KeyValuePair<Type, XmlRootAttribute>, XmlSerializer>(TempAssemblyComparer.s_default);
610 }
612 key.Value.ElementName = attribute.ElementName;
613 key.Value.Namespace = attribute.Namespace;
614 key.Value.DataType = attribute.DataType;
615 key.Value.IsNullable = attribute.IsNullable;
616 value = s_serializerFactory.CreateSerializer(type, attribute);
617 dictionary.Add(key, value);
619 }
620 }
621 }
622 return value;
623 }
void Add(TKey key, TValue value)
static Dictionary< KeyValuePair< Type, XmlRootAttribute >, XmlSerializer > s_tempAssemblyCache
static readonly XmlSerializerFactory s_serializerFactory
static void VerifyIDynamicMetaObjectProvider(Type type)
static readonly object s_tempAssemblyCacheLock

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.dictionary, System.Xml.Dictionary, System.item, System.key, System.Data.Common.ObjectStorage.TempAssemblyComparer.s_default, System.Data.Common.ObjectStorage.s_serializerFactory, System.Data.Common.ObjectStorage.s_tempAssemblyCache, System.Data.Common.ObjectStorage.s_tempAssemblyCacheLock, System.type, System.value, and System.Data.Common.ObjectStorage.VerifyIDynamicMetaObjectProvider().