Files
Nitrox/NitroxModel/Serialization/IProperties.cs
2025-07-06 00:23:46 +02:00

22 lines
577 B
C#

using System;
using System.ComponentModel;
namespace NitroxModel.Serialization;
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class, Inherited = false)]
public sealed class PropertyDescriptionAttribute : DescriptionAttribute
{
public PropertyDescriptionAttribute(string desc) : base(desc)
{
}
public PropertyDescriptionAttribute(string desc, Type type)
{
if (type.IsEnum)
{
desc += $" {string.Join(", ", type.GetEnumNames())}";
DescriptionValue = desc;
}
}
}