using System; using System.ComponentModel; using Pinwheel.Extensions; namespace Pinwheel { [DisplayName("Base Award")] [Description("This is the base class inherited by every Award.")] public abstract class Award { public abstract AwardType Type { get; } public DateTime Timestamp { get; set; } public User User { get; set; } protected Award() { Timestamp = DateTime.Now; } private string name; public virtual string Name { get { if (name == null) name = GetType().GetNameFromAttribute(); return name; } set { name = value; } } private string description; public virtual string Description { get { if (description == null) name = GetType().GetDescriptionFromAttribute(); return description; } set { description = value; } } public override string ToString() { return Name; } } }