dotnetify

How to serialize runtime added “properties” to Json

萝らか妹 提交于 2020-02-22 06:18:51
问题 I implemented the possibility to add "properties" at runtime to objects with special SystemComponent.PropertyDescriptor-s. Due to the fact that these properties are only accessible with the ComponentModel.TypeDescriptor and not via Reflection, the properties work well in WPF environment but not with Serialization. This is because of all JSON serializers, that I know, use reflection on the type. I analyzed Newtonsoft.Json, System.Json, System.Web.Script.JavaScriptSerializer, System.Runtime

How to serialize runtime added “properties” to Json

孤者浪人 提交于 2019-12-06 01:49:32
I implemented the possibility to add "properties" at runtime to objects with special SystemComponent.PropertyDescriptor-s. Due to the fact that these properties are only accessible with the ComponentModel.TypeDescriptor and not via Reflection, the properties work well in WPF environment but not with Serialization. This is because of all JSON serializers, that I know, use reflection on the type. I analyzed Newtonsoft.Json, System.Json, System.Web.Script.JavaScriptSerializer, System.Runtime.Serialization.Json. I don't think I can use any of these serializers because none of these allow modifying