void Update(LogOption option) { Level = option.Level; Enable = option.Enable; Service = option.Service ?? "log"; LogApi = option.LogApi ?? "text"; MonitorApi = option.MonitorApi ?? "monitor"; }
void IZeroOption.Load(bool first) { LogOption option = ConfigurationHelper.Get <LogOption>(sectionName); if (first) { if (option == null) { Enable = true; Level = LogLevel.Information; Service = "log"; LogApi = "text"; MonitorApi = "monitor"; } ConfigurationHelper.RegistOnChange <LogOption>("MessageMVC:Tools", Update, false); } if (option != null) { Update(option); } }