Esempio n. 1
0
        public static void LoadConfig()
        {
            if (!File.Exists(jsonPath))
            {
                DirUtil.CreateDirectoryIfNotExist(ConfigFolder);

                Instance = new UserConfig();
                Instance.LoadDefaults();

                string jsonString = JsonConvert.SerializeObject(Instance, Formatting.Indented);
                DirUtil.WriteTextToFile(jsonPath, jsonString);
            }

            Instance = new UserConfig();
            JsonConvert.PopulateObject(DirUtil.ReadTextFile(jsonPath), Instance);
        }
Esempio n. 2
0
 private void btnDumpChatLog_Click(object sender, RoutedEventArgs e)
 {
     DirUtil.CreateDirectoryIfNotExist("ServerChatDump");
     File.WriteAllLines("ServerChatDump/serverchatdump.txt", GetServerLogText(true));
 }