Newtonsoft.Json/SerializationBinder.cs

(完整代码) 1KB


#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
using System;
using System.Reflection;

namespace Newtonsoft.Json
{
    /// <summary>
    /// Allows users to control class loading and mandate what class to load.
    /// </summary>
    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="Type"/> name of the serialized object</param>
        /// <returns>The type of the object the formatter creates a new instance of.</returns>
        public abstract Type BindToType(string assemblyName, string typeName);

        /// <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="Type"/> name of the serialized object.</param>
        public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName)
        {
            assemblyName = null;
            typeName = null;
        }
    }
}

#endif

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。