csharp-sdk-upm/Libs/Newtonsoft.Json/SerializationBinder.cs

36 lines
1.6 KiB
C#
Raw Normal View History

2021-03-29 14:54:12 +08:00

#if (DOTNET || PORTABLE40 || PORTABLE)
using System;
using System.Reflection;
namespace LC.Newtonsoft.Json
{
/// <summary>
/// Allows users to control class loading and mandate what class to load.
/// </summary>
[Obsolete("SerializationBinder is obsolete. Use ISerializationBinder instead.")]
public abstract class SerializationBinder
{
/// <summary>
/// When overridden in a derived class, controls the binding of a serialized object to a type.
/// </summary>
/// <param name="assemblyName">Specifies the <see cref="Assembly"/> name of the serialized object.</param>
/// <param name="typeName">Specifies the <see cref="System.Type"/> name of the serialized object</param>
/// <returns>The type of the object the formatter creates a new instance of.</returns>
2021-03-30 10:54:25 +08:00
public abstract Type BindToType(string assemblyName, string typeName);
2021-03-29 14:54:12 +08:00
/// <summary>
/// When overridden in a derived class, controls the binding of a serialized object to a type.
/// </summary>
/// <param name="serializedType">The type of the object the formatter creates a new instance of.</param>
/// <param name="assemblyName">Specifies the <see cref="Assembly"/> name of the serialized object.</param>
/// <param name="typeName">Specifies the <see cref="System.Type"/> name of the serialized object.</param>
2021-03-30 10:54:25 +08:00
public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName)
2021-03-29 14:54:12 +08:00
{
assemblyName = null;
typeName = null;
}
}
}
#endif