using System; namespace JD.TeaBoxAddinSystem.Addins { /// /// Attribute that is used to signify that the property/field can be deserialized from a string. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple=false)] public class StringPropertyConverterAttribute : Attribute { #region Variables private readonly string m_name; private readonly bool m_required; private readonly string m_description; #endregion #region Constructor /// /// Constructor. /// public StringPropertyConverterAttribute() : this(null, false, null) { } /// /// Constructor. /// /// public StringPropertyConverterAttribute(bool required) : this(null, required, null) { } /// /// Constructor. /// /// public StringPropertyConverterAttribute(string name) : this(name, false, null) { } /// /// Constructor. /// /// /// public StringPropertyConverterAttribute(string name, bool required) : this(name, required, null) { } /// /// Constructor. /// /// /// /// public StringPropertyConverterAttribute(string name, bool required, string description) { m_name = name; m_required = required; m_description = description; } #endregion #region Properties /// /// Name of the serialized field. /// public string Name { get { return m_name; } } /// /// Whether the member with this attribute represents a required field. /// public bool Required { get { return m_required; } } /// /// Description. /// public string Description { get { return m_description; } } #endregion } }