using NCC.Dependency; using System; namespace NCC.ConfigurableOptions { /// /// 选项配置特性 /// [SuppressSniffer, AttributeUsage(AttributeTargets.Class)] public sealed class OptionsSettingsAttribute : Attribute { /// /// 构造函数 /// public OptionsSettingsAttribute() { } /// /// 构造函数 /// /// appsetting.json 对应键 public OptionsSettingsAttribute(string path) { Path = path; } /// /// 构造函数 /// /// 启动所有实例进行后期配置 public OptionsSettingsAttribute(bool postConfigureAll) { PostConfigureAll = postConfigureAll; } /// /// 构造函数 /// /// appsetting.json 对应键 /// 启动所有实例进行后期配置 public OptionsSettingsAttribute(string path, bool postConfigureAll) { Path = path; PostConfigureAll = postConfigureAll; } /// /// 对应配置文件中的路径 /// public string Path { get; set; } /// /// 对所有配置实例进行后期配置 /// public bool PostConfigureAll { get; set; } } }