Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FloatDataContract.cs
Go to the documentation of this file.
2using System.Xml;
3
5
7{
8 internal override string WriteMethodName => "WriteFloat";
9
10 internal override string ReadMethodName => "ReadElementContentAsFloat";
11
13 : base(typeof(float), DictionaryGlobals.FloatLocalName, DictionaryGlobals.SchemaNamespace)
14 {
15 }
16
17 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
19 {
20 writer.WriteFloat((float)obj);
21 }
22
23 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
24 public override object ReadXmlValue(XmlReaderDelegator reader, XmlObjectSerializerReadContext context)
25 {
26 if (context != null)
27 {
28 return HandleReadValue(reader.ReadElementContentAsFloat(), context);
29 }
30 return reader.ReadElementContentAsFloat();
31 }
32
33 [RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
35 {
36 xmlWriter.WriteFloat((float)obj, name, ns);
37 }
38}
override void WriteXmlElement(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, XmlDictionaryString name, XmlDictionaryString ns)
override object ReadXmlValue(XmlReaderDelegator reader, XmlObjectSerializerReadContext context)
override void WriteXmlValue(XmlWriterDelegator writer, object obj, XmlObjectSerializerWriteContext context)
object HandleReadValue(object obj, XmlObjectSerializerReadContext context)