Fix `ApiInjector` trying to set get-only props of type `ApiContainer`
This commit is contained in:
parent
16ee704332
commit
3c00c24fcd
|
@ -35,8 +35,12 @@ namespace BizHawk.Client.Common
|
|||
Type targetType = target.GetType();
|
||||
object[] tmp = new object[1];
|
||||
|
||||
targetType.GetProperties(ReflectionExtensions.DI_TARGET_PROPS).FirstOrDefault(pi => pi.PropertyType == typeof(ApiContainer))
|
||||
?.SetValue(target, source.Container);
|
||||
foreach (var mi in targetType.GetProperties(ReflectionExtensions.DI_TARGET_PROPS)
|
||||
.Where(static pi => pi.PropertyType == typeof(ApiContainer))
|
||||
.Select(static pi => pi.SetMethod))
|
||||
{
|
||||
mi?.Invoke(target, new object[] { source.Container });
|
||||
}
|
||||
|
||||
foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(RequiredApiAttribute)))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue