Example #1
0
        public static void LoadLocalFile()
        {
            s_Locals.Clear();

            if (s_Locals.Count == 0)
            {
                s_Locals = DefaultLocal.Load();
            }
        }
Example #2
0
        public static void LoadLocalFile()
        {
            s_Locals.Clear();

            if (File.Exists("Data/ChatLocal.txt"))
            {
                using (FileStream bin = new FileStream("Data/ChatLocal.txt", FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    StreamReader reader = new StreamReader(bin);
                    string       text   = "";

                    while (true)
                    {
                        try
                        {
                            text = reader.ReadLine();

                            if (text.IndexOf("//") == 0 || text.Trim().Length == 0)
                            {
                                continue;
                            }

                            if (text == "EndOfFile")
                            {
                                break;
                            }

                            s_Locals.Add(text);
                        }
                        catch { break; }
                    }

                    reader.Close();
                }
            }

            if (s_Locals.Count == 0)
            {
                s_Locals = DefaultLocal.Load();
            }
        }