From b8d5c718429f1325111834b8b95698fc9c9ba47d Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sat, 23 Feb 2013 02:57:11 -0500 Subject: type discovery without attributes --- .../Localization/LocalizedStringData.cs | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 MediaBrowser.Controller/Localization/LocalizedStringData.cs (limited to 'MediaBrowser.Controller/Localization/LocalizedStringData.cs') diff --git a/MediaBrowser.Controller/Localization/LocalizedStringData.cs b/MediaBrowser.Controller/Localization/LocalizedStringData.cs new file mode 100644 index 000000000..71200b8c8 --- /dev/null +++ b/MediaBrowser.Controller/Localization/LocalizedStringData.cs @@ -0,0 +1,51 @@ +using System.IO; +using System.Xml.Serialization; + +namespace MediaBrowser.Controller.Localization +{ + /// + /// Class LocalizedStringData + /// + public class LocalizedStringData + { + /// + /// The this version + /// + [XmlIgnore] + public string ThisVersion = "1.0000"; + /// + /// The prefix + /// + [XmlIgnore] + public string Prefix = ""; + /// + /// The file name + /// + public string FileName; //this is public so it will serialize and we know where to save ourselves + /// + /// The version + /// + public string Version = ""; //this will get saved so we can check it against us for changes + + /// + /// Saves this instance. + /// + public void Save() + { + Save(FileName); + } + + /// + /// Saves the specified file. + /// + /// The file. + 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); + } + } + } +} -- cgit v1.2.3