1
0
mirror of synced 2024-11-30 22:17:17 +01:00
TaikoSoundEditor/Commons/Extensions/ObjectExtensions.cs

14 lines
369 B
C#
Raw Normal View History

2023-10-01 18:40:41 +02:00
using System.Linq;
namespace TaikoSoundEditor.Commons.Extensions
{
internal static class ObjectExtensions
{
public static string ToStringProperties(this object obj)
{
2023-10-01 22:06:50 +02:00
return obj.GetType() + "{" + string.Join("; ", obj.GetType().GetProperties().Select(p => $"{p.Name}=`{p?.GetValue(obj) ?? "(null)"}`")) + "}";
2023-10-01 18:40:41 +02:00
}
}
}