JD2022-TU1/main/tools/framework/JD.Serializers/SerializerHelper.cs

22 lines
574 B
C#

using System.Runtime.Serialization;
using JD.Kernel.StaticHelpers;
namespace JD.Serializers
{
/// <summary>
/// Provides helpful functions of serialization.
/// </summary>
public static class SerializerHelper
{
/// <summary>
/// Gets the value on the name.
/// </summary>
public static TValue GetValue<TValue>(string name, SerializationInfo info)
{
Throw.IfEmpty(name, "name");
Throw.IfNull(info, "info");
return (TValue)info.GetValue(name, typeof(TValue));
}
}
}