22 lines
574 B
C#
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));
|
|
}
|
|
}
|
|
}
|