first commit
This commit is contained in:
21
NitroxModel/Serialization/IProperties.cs
Normal file
21
NitroxModel/Serialization/IProperties.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user