using System;
namespace DPumpHydr.WinFrmUI.WenSkin.Json
{
///
/// Instructs the to use the specified when serializing the member or class.
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter, AllowMultiple = false)]
public sealed class JsonConverterAttribute : Attribute
{
private readonly Type _converterType;
///
/// Gets the of the .
///
/// The of the .
public Type ConverterType => _converterType;
///
/// The parameter list to use when constructing the described by ConverterType.
/// If null, the default constructor is used.
///
public object[] ConverterParameters { get; private set; }
///
/// Initializes a new instance of the class.
///
/// Type of the .
public JsonConverterAttribute(Type converterType)
{
if (converterType == null)
{
throw new ArgumentNullException("converterType");
}
_converterType = converterType;
}
///
/// Initializes a new instance of the class.
///
/// Type of the .
/// Parameter list to use when constructing the . Can be null.
public JsonConverterAttribute(Type converterType, params object[] converterParameters)
: this(converterType)
{
ConverterParameters = converterParameters;
}
}
}