CPF/CPF.Windows/Json/Attribute/JsonDeserializeCtorAttribute.cs
2023-11-21 23:05:03 +08:00

25 lines
854 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace CPF.Windows.Json
{
/// <summary>
/// 对Model进行Json反序列化时指定一个构造函数
/// Specify a constructor for Json deserialization of Model
/// </summary>
[AttributeUsage(AttributeTargets.Constructor)]
public class JsonDeserializeCtorAttribute : Attribute
{
internal object[] _args;
/// <summary>
/// 反序列化时的指定构造函数以及参数args必须和构造函数参数匹配
/// Deserializing the specified constructor and parameters, args must match the constructor parameters
/// </summary>
/// <param name="args">该构造函数的参数,The parameters of the constructor</param>
public JsonDeserializeCtorAttribute(params object[] args)
{
_args = args;
}
}
}