muddesigner/Mud Designer/MudEngine/FileSystem/FileSystem.cs
Scionwest_cp b87136bc13 Project restructure completed. All editors now contained within a single Project.
Note that some things are still broken from the migration, but will be addressed.
2009-12-01 19:27:01 -08:00

52 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MudDesigner.MudEngine.FileSystem
{
public static class FileSystem
{
public enum OutputFormats
{
XML = 0,
}
/// <summary>
/// The filetype that the MUDs files will be saved as
/// </summary>
public static OutputFormats FileType
{
get;
set;
}
/// <summary>
/// Saves the object using the specified output format
/// </summary>
/// <param name="Filename"></param>
/// <param name="o"></param>
public static void Save(string Filename, object o)
{
if (FileType == OutputFormats.XML)
{
XmlSerialization.Save(Filename, o);
}
}
/// <summary>
/// Loads the object using the specified FileType format
/// </summary>
/// <param name="Filename"></param>
/// <param name="o"></param>
/// <returns></returns>
public static object Load(string Filename, object o)
{
if (FileType == OutputFormats.XML)
{
return XmlSerialization.Load(Filename, o);
}
else return null;
}
}
}