Extensions.cs 915 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. namespace LitJson.Extensions {
  3. /// <summary>
  4. /// 拓展方法
  5. /// </summary>
  6. public static class Extensions {
  7. public static void WriteProperty(this JsonWriter w,string name,long value){
  8. w.WritePropertyName(name);
  9. w.Write(value);
  10. }
  11. public static void WriteProperty(this JsonWriter w,string name,string value){
  12. w.WritePropertyName(name);
  13. w.Write(value);
  14. }
  15. public static void WriteProperty(this JsonWriter w,string name,bool value){
  16. w.WritePropertyName(name);
  17. w.Write(value);
  18. }
  19. public static void WriteProperty(this JsonWriter w,string name,double value){
  20. w.WritePropertyName(name);
  21. w.Write(value);
  22. }
  23. }
  24. /// <summary>
  25. /// 跳过序列化的标签
  26. /// </summary>
  27. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
  28. public sealed class JsonIgnore : Attribute
  29. {
  30. }
  31. }