Exemple #1
0
            public static TypeC Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj)
            {
                var instance = new TypeC();

                {
                    {
                        instance.BList = new global::System.Collections.Generic.List <global::Improbable.TestSchema.TypeB>();
                        var list       = instance.BList;
                        var listLength = obj.GetObjectCount(2);
                        for (var i = 0; i < listLength; i++)
                        {
                            list.Add(global::Improbable.TestSchema.TypeB.Serialization.Deserialize(obj.IndexObject(2, (uint)i)));
                        }
                    }
                }
                {
                    {
                        var map     = new global::System.Collections.Generic.Dictionary <string, global::Improbable.TestSchema.TypeB>();
                        var mapSize = obj.GetObjectCount(4);
                        instance.BMap = map;
                        for (var i = 0; i < mapSize; i++)
                        {
                            var mapObj = obj.IndexObject(4, (uint)i);
                            var key    = mapObj.GetString(1);
                            var value  = global::Improbable.TestSchema.TypeB.Serialization.Deserialize(mapObj.GetObject(2));
                            map.Add(key, value);
                        }
                    }
                }
                return(instance);
            }
Exemple #2
0
 public static void Serialize(TypeC instance, global::Improbable.Worker.CInterop.SchemaObject obj)
 {
     {
         foreach (var value in instance.BList)
         {
             global::Improbable.TestSchema.TypeB.Serialization.Serialize(value, obj.AddObject(2));
         }
     }
     {
         foreach (var keyValuePair in instance.BMap)
         {
             var mapObj = obj.AddObject(4);
             mapObj.AddString(1, keyValuePair.Key);
             global::Improbable.TestSchema.TypeB.Serialization.Serialize(keyValuePair.Value, mapObj.AddObject(2));
         }
     }
 }