Exemplo n.º 1
0
        internal static void InitSettings()
        {
            _baseDir = Portable ? Env.CurrentDirectory : Dirs.AppData;

            Env.SetEnvironmentVariable("BRC_VER", Assembly.GetExecutingAssembly().GetName().Version.ToString());

            _setts = LoadInternal(Path.Combine(_baseDir, SETTINGS_FILE));
        }
Exemplo n.º 2
0
        private static void SaveInternal(BrcSettings def, string settingsPath)
        {
            var json = JsonConvert.SerializeObject(def, Formatting.Indented);

            var settingsDir = Directory.GetParent(settingsPath).FullName;

            if (!Directory.Exists(settingsDir))
            {
                Directory.CreateDirectory(settingsDir);
            }

            File.WriteAllText(settingsPath, json);
        }