From 7ec00462ac97eaa8a42deb29f97bc585d2726be0 Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Sun, 30 Jan 2022 17:15:20 -0500 Subject: [PATCH 1/2] chore: mark PluginServiceAttribute with MeansImplicitUse --- Dalamud/IoC/PluginServiceAttribute.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dalamud/IoC/PluginServiceAttribute.cs b/Dalamud/IoC/PluginServiceAttribute.cs index 80baceb55..0cf107677 100644 --- a/Dalamud/IoC/PluginServiceAttribute.cs +++ b/Dalamud/IoC/PluginServiceAttribute.cs @@ -1,11 +1,14 @@ using System; +using JetBrains.Annotations; + namespace Dalamud.IoC { /// /// This attribute indicates whether an applicable service should be injected into the plugin. /// [AttributeUsage(AttributeTargets.Property)] + [MeansImplicitUse(ImplicitUseKindFlags.Assign)] public class PluginServiceAttribute : Attribute { } From 0ba22c44cbcae4867b3f460fed3e51c8019dbbe7 Mon Sep 17 00:00:00 2001 From: Cara Date: Mon, 31 Jan 2022 21:45:09 +1030 Subject: [PATCH 2/2] (fix) Don't show properties that require parameters in ShowStruct Stop exploding --- Dalamud/Utility/Util.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index b3b370a9a..4cc1f8cee 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -279,7 +279,7 @@ namespace Dalamud.Utility ShowValue(addr, new List(path) { f.Name }, f.FieldType, f.GetValue(obj)); } - foreach (var p in obj.GetType().GetProperties()) + foreach (var p in obj.GetType().GetProperties().Where(p => p.GetGetMethod()?.GetParameters().Length == 0)) { ImGui.TextColored(new Vector4(0.2f, 0.9f, 0.9f, 1), $"{p.PropertyType.Name}"); ImGui.SameLine(); @@ -347,7 +347,7 @@ namespace Dalamud.Utility ImGui.Indent(); - foreach (var propertyInfo in type.GetProperties()) + foreach (var propertyInfo in type.GetProperties().Where(p => p.GetGetMethod()?.GetParameters().Length == 0)) { var value = propertyInfo.GetValue(obj); var valueType = value?.GetType();