public RegeditReporterConfig(IPhisingReporterConfig fallback) { foreach (var interfaceProperty in GetFallbackValuesAsDictionary(fallback)) { GetType().GetProperty(interfaceProperty.Key)?.SetValue(this, GetValue(interfaceProperty.Key, interfaceProperty.Value), null); } }
public static IDictionary <string, object> GetFallbackValuesAsDictionary(IPhisingReporterConfig dataSource) { return(typeof(IPhisingReporterConfig).GetProperties().ToDictionary(x => x.Name, x => x.GetValue(dataSource, null))); }