mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-07 07:00:33 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
47
server/tso.common/Utils/XMLList.cs
Executable file
47
server/tso.common/Utils/XMLList.cs
Executable file
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
|
||||
namespace FSO.Common.Utils
|
||||
{
|
||||
public class XMLList<T> : List<T>, IXMLEntity where T : IXMLEntity
|
||||
{
|
||||
private string NodeName;
|
||||
|
||||
public XMLList(string nodeName)
|
||||
{
|
||||
this.NodeName = nodeName;
|
||||
}
|
||||
|
||||
public XMLList()
|
||||
{
|
||||
this.NodeName = "Unknown";
|
||||
}
|
||||
|
||||
#region IXMLPrinter Members
|
||||
|
||||
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc)
|
||||
{
|
||||
var element = doc.CreateElement(NodeName);
|
||||
foreach (var child in this)
|
||||
{
|
||||
element.AppendChild(child.Serialize(doc));
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public void Parse(System.Xml.XmlElement element)
|
||||
{
|
||||
var type = typeof(T);
|
||||
|
||||
foreach (XmlElement child in element.ChildNodes)
|
||||
{
|
||||
var instance = (T)Activator.CreateInstance(type);
|
||||
instance.Parse(child);
|
||||
this.Add(instance);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue