12345678910111213141516171819202122232425262728293031323334353637383940 |
- /*-------------------------------------------------------------------------
- * 功能描述:BimIdConverter
- * 作者:xulisong
- * 创建时间: 2019/6/18 11:16:54
- * 版本号:v1.0
- * -------------------------------------------------------------------------*/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using JBIM;
- using Newtonsoft.Json;
- namespace RevitToJBim.JsonConverter
- {
- public class BimIdConverter : Newtonsoft.Json.JsonConverter
- {
- public override bool CanConvert(Type objectType)
- {
- return objectType == typeof(BimId);
- }
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- throw new NotImplementedException();
- }
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
- {
- if (value == null)
- {
- writer.WriteNull();
- return;
- }
- writer.WriteValue(value.ToString());
- }
- }
- }
|