6using Newtonsoft.Json.Bson;
7using Newtonsoft.Json.Linq;
24 private readonly
object _lock =
new object();
52 Formatting = (Formatting)1
59 Formatting = (Formatting)1
99 if (this.OnLoad !=
null)
120 if (this.OnSave !=
null)
136 if (this.OnProcessText !=
null)
224 currentValue = Get(name, currentValue);
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ContainsKey(TKey key)
static ? object ChangeType(object? value, TypeCode typeCode)
static ? DirectoryInfo GetParent(string path)
static void SetAttributes(string path, FileAttributes fileAttributes)
static FileStream Create(string path)
static bool Exists([NotNullWhen(true)] string? path)
static FileStream OpenRead(string path)
static void WriteAllText(string path, string? contents)
static string ReadAllText(string path)
delegate void TextProcessAction(ref string text)
Preferences(string path, bool parseAllTypes=false, bool useBson=false)
Dictionary< string, object > _data
bool Contains(string name)
Action< Preferences > OnLoad
T Get< T >(string name, T defaultValue)
Action< Preferences > OnSave
List< string > GetAllKeys()
void Put(string name, object value)
bool Save(bool canCreateFile=true)
readonly JsonSerializerSettings _serializerSettings
TextProcessAction OnProcessText
static string GetTextValue(string key)