IMarshalContext.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace TBL.CSharp.Serialization.Marshal
  2. {
  3. /// <summary>
  4. /// Marshal 风格的序列化上下文接口
  5. /// </summary>
  6. public interface IMarshalContext
  7. {
  8. /// <summary>
  9. /// 清空上下文内容
  10. /// </summary>
  11. void Clear();
  12. /// <summary>
  13. /// 获取可链接符号
  14. /// </summary>
  15. string GetLinkableSymbol(int index);
  16. /// <summary>
  17. /// 添加可链接符号
  18. /// </summary>
  19. string AddLinkableSymbol(string symbol);
  20. /// <summary>
  21. /// 寻找可链接符号的索引
  22. /// </summary>
  23. bool FindLinkableSymbol(string symbol, out int index);
  24. /// <summary>
  25. /// 获取可链接对象
  26. /// </summary>
  27. object GetLinkableObject(int index);
  28. /// <summary>
  29. /// 添加可链接对象
  30. /// </summary>
  31. T AddLinkableObject<T>(T element);
  32. /// <summary>
  33. /// 寻找可链接对象的索引
  34. /// </summary>
  35. bool FindLinkableObject(object element, out int index);
  36. }
  37. }