mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
31 lines
635 B
C#
31 lines
635 B
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace ConfigGenerator {
|
|
internal class ASFConfig {
|
|
internal static List<ASFConfig> ASFConfigs = new List<ASFConfig>();
|
|
|
|
internal string FilePath { get; set; }
|
|
|
|
protected ASFConfig() {
|
|
ASFConfigs.Add(this);
|
|
}
|
|
|
|
protected ASFConfig(string filePath) : base() {
|
|
FilePath = filePath;
|
|
}
|
|
|
|
internal virtual void Save() {
|
|
lock (FilePath) {
|
|
try {
|
|
File.WriteAllText(FilePath, JsonConvert.SerializeObject(this, Formatting.Indented));
|
|
} catch (Exception e) {
|
|
Logging.LogGenericException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|