using CefSharp.DevTools.IndexedDB; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Work; /// /// 主账号云端配置 /// public class UserConfig { public const string SensitiveWordsKey = "SensitiveWords"; public const string UseOrderReturnWarehouseAddressKey = "UseOrderReturnWarehouseAddress"; public Dictionary Configs { get; set; } = []; public ConfigItem this[string key] { get => Configs.TryGetValue(key, out var item) ? item : null; } public bool TryGetConfig(string key, out ConfigItem item) { return Configs.TryGetValue(key, out item); } public enum InheritPolicy { /// /// 自由 /// Free = 0, /// /// 锁定 /// Locked = 1, /// /// 追加 /// AppendOnly = 2 } public class ConfigItem { public string Key { get; set; } public string Value { get; set; } public InheritPolicy Policy { get; set; } = InheritPolicy.Free; } }