Loads a Caret Separated Text (CST) file.
Esempio n. 1
0
        /// <summary>
        /// Initializes the StringManager.
        /// </summary>
        /// <param name="Path">Path to TSO directory.</param>
        /// <param name="StringDir">TSO's string directory.</param>
        /// <param name="Language">The language to use, without ".dir" extension.</param>
        public static void Initialize(string Path, string StringDir, string Language)
        {
            if (IsLinux)
            {
                foreach (string CSTPath in GetFileList("*.cst", Path + StringDir + "/" + Language + ".dir"))
                {
                    CaretSeparatedText StringTable = new CaretSeparatedText(CSTPath);
                    int ID = int.Parse(System.IO.Path.GetFileName(CSTPath).Split("_".ToCharArray(),
                                                                                 StringSplitOptions.RemoveEmptyEntries) [0]);

                    m_StringTables.Add(ID, StringTable);
                }
            }
            else
            {
                foreach (string CSTPath in GetFileList("*.cst", Path + StringDir + "\\" + Language + ".dir"))
                {
                    CaretSeparatedText StringTable = new CaretSeparatedText(CSTPath);
                    int ID = int.Parse(System.IO.Path.GetFileName(CSTPath).Split("_".ToCharArray(),
                                                                                 StringSplitOptions.RemoveEmptyEntries) [0]);

                    m_StringTables.Add(ID, StringTable);
                }
            }
        }
        /// <summary>
        /// Initializes the StringManager.
        /// </summary>
        /// <param name="Path">Path to TSO directory.</param>
        /// <param name="StringDir">TSO's string directory.</param>
        /// <param name="Language">The language to use, without ".dir" extension.</param>
        public static void Initialize(string Path, string StringDir, string Language)
        {
            if (IsLinux)
            {
                foreach (string CSTPath in GetFileList("*.cst", Path + StringDir + "/" + Language + ".dir")) {
                    CaretSeparatedText StringTable = new CaretSeparatedText (CSTPath);
                    int ID = int.Parse (System.IO.Path.GetFileName (CSTPath).Split ("_".ToCharArray (),
                                 StringSplitOptions.RemoveEmptyEntries) [0]);

                    m_StringTables.Add (ID, StringTable);
                }
            }
            else
            {
                foreach (string CSTPath in GetFileList("*.cst", Path + StringDir + "\\" + Language + ".dir")) {
                    CaretSeparatedText StringTable = new CaretSeparatedText (CSTPath);
                    int ID = int.Parse (System.IO.Path.GetFileName (CSTPath).Split ("_".ToCharArray (),
                                            StringSplitOptions.RemoveEmptyEntries) [0]);

                    m_StringTables.Add (ID, StringTable);
                }
            }
        }