Renamed MudEngine.FileSystem folder to MudEngine.DAL (Data Access Layer)
Deleted the Attributes folder as it is no longer used. Moved Server.cs from Networking to Communication folder. Classes all still reside within their original namespaces, just migrating files into their new folders. Namespace migration will take place afterwards.
This commit is contained in:
parent
98e01dfd98
commit
373b8b66b8
6 changed files with 6 additions and 7 deletions
40
MudEngine/DAL/XmlSerialization.cs
Normal file
40
MudEngine/DAL/XmlSerialization.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
//Microsoft .NET Framework
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace MudEngine.FileSystem
|
||||
{
|
||||
internal class XmlSerialization
|
||||
{
|
||||
internal static void Save(String Filename, object o)
|
||||
{
|
||||
Stream stream = File.Create(Filename);
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(o.GetType());
|
||||
serializer.Serialize(stream, o);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Loads an item via Xml Deserialization
|
||||
/// </summary>
|
||||
/// <param name="Filename">The Xml document to deserialize.</param>
|
||||
/// <returns></returns>
|
||||
internal static object Load(String Filename, object o)
|
||||
{
|
||||
Stream stream = File.OpenRead(Filename);
|
||||
|
||||
object obj = new object();
|
||||
XmlSerializer serializer = new XmlSerializer(o.GetType());
|
||||
obj = (object)serializer.Deserialize(stream);
|
||||
|
||||
stream.Close();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue