2013-02-20 18:33:05 -07:00
|
|
|
using System.IO;
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
2013-02-23 00:57:11 -07:00
|
|
|
namespace MediaBrowser.Controller.Localization
|
2013-02-20 18:33:05 -07:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Class LocalizedStringData
|
|
|
|
/// </summary>
|
|
|
|
public class LocalizedStringData
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The this version
|
|
|
|
/// </summary>
|
|
|
|
[XmlIgnore]
|
|
|
|
public string ThisVersion = "1.0000";
|
|
|
|
/// <summary>
|
|
|
|
/// The prefix
|
|
|
|
/// </summary>
|
|
|
|
[XmlIgnore]
|
|
|
|
public string Prefix = "";
|
|
|
|
/// <summary>
|
|
|
|
/// The file name
|
|
|
|
/// </summary>
|
|
|
|
public string FileName; //this is public so it will serialize and we know where to save ourselves
|
|
|
|
/// <summary>
|
|
|
|
/// The version
|
|
|
|
/// </summary>
|
|
|
|
public string Version = ""; //this will get saved so we can check it against us for changes
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves this instance.
|
|
|
|
/// </summary>
|
|
|
|
public void Save()
|
|
|
|
{
|
|
|
|
Save(FileName);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the specified file.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="file">The file.</param>
|
|
|
|
public void Save(string file)
|
|
|
|
{
|
|
|
|
var xs = new XmlSerializer(GetType());
|
|
|
|
using (var fs = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None))
|
|
|
|
{
|
|
|
|
xs.Serialize(fs, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|