Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
XElementSerializer.cs
浏览该文件的文档.
1using System.Xml.Linq;
2
3namespace Engine.Serialization {
4 public class XElementSerializer : ISerializer<XElement> {
5 public void Serialize(InputArchive archive, ref XElement value) {
6 if (archive is XmlInputArchive xmlInputArchive) {
7 value = xmlInputArchive.Node.Elements().First();
8 return;
9 }
10 string value2 = null;
11 archive.Serialize(null, ref value2);
12 value = XElement.Parse(value2);
13 }
14
15 public void Serialize(OutputArchive archive, XElement value) {
16 if (archive is XmlOutputArchive xmlOutputArchive) {
17 xmlOutputArchive.Node.Add(value);
18 }
19 else {
20 archive.Serialize(null, value.ToString());
21 }
22 }
23 }
24}
void Serialize(string name, ref sbyte value)
void Serialize(string name, sbyte value)
void Serialize(InputArchive archive, ref XElement value)
void Serialize(OutputArchive archive, XElement value)