Mercurial > repos > IBBoard
view Constants.cs @ 78:da339d10c5fe
Re #32: Add staged loading of translations
* Add "XML Translation Set" that lazy loads translations from XML
* Extract some methods out to an XML extractor
* Fix header in abstract translation set
* Extract method in Translation class to add a translation set (allows combined file loading and in-code creation)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 09 Apr 2010 19:35:18 +0000 |
parents | cc7fae81afec |
children | 0f88d32b22cc |
line wrap: on
line source
// This file (Constants.cs) is a part of the IBBoard library and is copyright 2009 IBBoard. // // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. using System; using System.IO; namespace IBBoard { /// <summary> /// Summary description for Constants. /// </summary> public class Constants { public static readonly char DirectoryChar = Path.DirectorySeparatorChar; public static readonly string DirectoryString = Path.DirectorySeparatorChar.ToString(); private static string executablePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(DirectoryChar); static Constants() { string exe = Environment.GetCommandLineArgs()[0]; int slash = exe.LastIndexOf(DirectoryChar) + 1; int dot = exe.LastIndexOf('.'); if (dot > slash) { exe = exe.Substring(slash, dot - slash); } else { exe = exe.Substring(slash); } userDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).TrimEnd(DirectoryChar) + DirectoryChar + "IBBoard" + DirectoryChar + exe; } public static string ExecutablePath { get { return executablePath; } } private static string userDataPath; public static string UserDataPath { get { return userDataPath; } } /*public static void RecreateUserDataPath(string path) { if (path!=null && path!="") { userDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+DirectoryChar+path.Trim(DirectoryChar); } }*/ } }