You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.6 KiB

  1. 
  2. #if (DOTNET || PORTABLE40 || PORTABLE)
  3. using System;
  4. using System.Reflection;
  5. namespace Newtonsoft.Json
  6. {
  7. /// <summary>
  8. /// Allows users to control class loading and mandate what class to load.
  9. /// </summary>
  10. [Obsolete("SerializationBinder is obsolete. Use ISerializationBinder instead.")]
  11. internal abstract class SerializationBinder
  12. {
  13. /// <summary>
  14. /// When overridden in a derived class, controls the binding of a serialized object to a type.
  15. /// </summary>
  16. /// <param name="assemblyName">Specifies the <see cref="Assembly"/> name of the serialized object.</param>
  17. /// <param name="typeName">Specifies the <see cref="System.Type"/> name of the serialized object</param>
  18. /// <returns>The type of the object the formatter creates a new instance of.</returns>
  19. public abstract Type BindToType(string assemblyName, string typeName);
  20. /// <summary>
  21. /// When overridden in a derived class, controls the binding of a serialized object to a type.
  22. /// </summary>
  23. /// <param name="serializedType">The type of the object the formatter creates a new instance of.</param>
  24. /// <param name="assemblyName">Specifies the <see cref="Assembly"/> name of the serialized object.</param>
  25. /// <param name="typeName">Specifies the <see cref="System.Type"/> name of the serialized object.</param>
  26. public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName)
  27. {
  28. assemblyName = null;
  29. typeName = null;
  30. }
  31. }
  32. }
  33. #endif