RaspberryIO_26/Swan.Tiny/Configuration/PropertyDisplayAttribute.cs

63 lines
1.3 KiB
C#
Raw Normal View History

2019-12-09 17:25:54 +01:00
using System;
namespace Swan.Configuration {
/// <summary>
/// An attribute used to include additional information to a Property for serialization.
///
/// Previously we used DisplayAttribute from DataAnnotation.
/// </summary>
/// <seealso cref="System.Attribute" />
[AttributeUsage(AttributeTargets.Property)]
public sealed class PropertyDisplayAttribute : Attribute {
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public String Name {
get; set;
}
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>
/// The description.
/// </value>
public String Description {
get; set;
}
/// <summary>
/// Gets or sets the name of the group.
/// </summary>
/// <value>
/// The name of the group.
/// </value>
public String GroupName {
get; set;
}
/// <summary>
/// Gets or sets the default value.
/// </summary>
/// <value>
/// The default value.
/// </value>
public Object DefaultValue {
get; set;
}
/// <summary>
/// Gets or sets the format string to call with method <c>ToString</c>.
/// </summary>
/// <value>
/// The format.
/// </value>
public String Format {
get; set;
}
}
}