Hermod
A cross-platform, modular and fully GDPR-compliant email archival solution!
Loading...
Searching...
No Matches
IConfigChanged.cs
Go to the documentation of this file.
1using System;
2
3namespace Hermod.Config {
4
5 public delegate void ConfigChangedEventHandler(object? sender, ConfigChangedEventArgs e);
6
10 public class ConfigChangedEventArgs: EventArgs {
11
15 public string ConfigName { get; set; }
16
20 public object? OldConfigValue { get; set; }
21
25 public object? NewConfigValue { get; set; }
26
30 public Type ConfigType { get; set; }
31
32 public ConfigChangedEventArgs(): this(string.Empty, default, default, typeof(object)) { }
33
34 public ConfigChangedEventArgs(string configName, object? oldCfgVal, object? newCfgVal, Type newCfgType) {
35 ConfigName = configName;
36 OldConfigValue = oldCfgVal;
37 NewConfigValue = newCfgVal;
38 ConfigType = newCfgType;
39 }
40
41 }
42
46 public interface IConfigChanged {
47
52
53 }
54}
55
Event arguments for when a configuration has changed.
ConfigChangedEventArgs(string configName, object? oldCfgVal, object? newCfgVal, Type newCfgType)
Type ConfigType
The type the new configuration value has.
string ConfigName
The name of the configuration that was changed.
object? OldConfigValue
The old config value, boxed to an object.
object? NewConfigValue
The new config value, boxed to an object.
Generic contract defining the behaviour when a config was changed.
ConfigChangedEventHandler? ConfigChanged
Handles situations where configurations are modified.
delegate void ConfigChangedEventHandler(object? sender, ConfigChangedEventArgs e)