Ejemplo n.º 1
0
        private void DeserializeWithSelfMadeType()
        {
            // If we do this, the plugin will not unload
            // If we move the type DeserializeMeSomething into the plugin project, it'll work just fine (see next method)
            var result = new DeserializeMeSomethingHost().DeserializeMeThis <JsonDeserializeType>(SampleJson);

            Console.WriteLine($"Deserialized with self made type: {result.Property}");

            /*
             *      HandleTable:
             *          0000026B055C1360 (strong handle)
             *          -> 0000026B1D8B5420 System.Object[]
             *          -> 0000026B058BD3D8 Newtonsoft.Json.Serialization.DefaultContractResolver
             *          -> 0000026B058BD588 Newtonsoft.Json.Utilities.ThreadSafeStore`2[[System.Type, System.Private.CoreLib],[Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json]]
             *          -> 0000026B058BD5A8 System.Collections.Concurrent.ConcurrentDictionary`2[[System.Type, System.Private.CoreLib],[Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json]]
             *          -> 0000026B058BD958 System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[System.Type, System.Private.CoreLib],[Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json]]
             *          -> 0000026B058BD848 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Type, System.Private.CoreLib],[Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json]][]
             *          -> 0000026B058EAF20 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Type, System.Private.CoreLib],[Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json]]
             *          -> 0000026B058CE320 System.RuntimeType
             *          -> 0000026B058BAD50 System.Reflection.LoaderAllocator
             *
             *          0000026B055C13E8 (strong handle)
             *          -> 0000026B1D8B1018 System.Object[]
             *          -> 0000026B058C1448 Newtonsoft.Json.Utilities.ThreadSafeStore`2[[System.Object, System.Private.CoreLib],[Newtonsoft.Json.JsonContainerAttribute, Newtonsoft.Json]]
             *          -> 0000026B058C1468 System.Collections.Concurrent.ConcurrentDictionary`2[[System.Object, System.Private.CoreLib],[Newtonsoft.Json.JsonContainerAttribute, Newtonsoft.Json]]
             *          -> 0000026B058C1800 System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[System.Object, System.Private.CoreLib],[Newtonsoft.Json.JsonContainerAttribute, Newtonsoft.Json]]
             *          -> 0000026B058C16F0 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Object, System.Private.CoreLib],[Newtonsoft.Json.JsonContainerAttribute, Newtonsoft.Json]][]
             *          -> 0000026B058E9EB0 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Object, System.Private.CoreLib],[Newtonsoft.Json.JsonContainerAttribute, Newtonsoft.Json]]
             *          -> 0000026B058CE320 System.RuntimeType
             *          -> 0000026B058BAD50 System.Reflection.LoaderAllocator
             */
        }
Ejemplo n.º 2
0
        private void DeserializeWithProvidedType()
        {
            // If we do this, the plugin will not unload
            var result = DeserializeMeSomethingHost.DeserializeMeThis <JsonDeserializeType>(SampleJson);

            Console.WriteLine($"Deserialized with provided type: {result.Property}");
        }