Closed GoogleCodeExporter closed 9 years ago
You can use a RuntimeTypeModel to tell it how to serialize types you don't
control, or in more complicated cases - add a surrogate. Are you using a
TypeModel currently?
Original comment by marc.gravell
on 6 Jun 2011 at 9:57
No I am not using either.
Are there any samples on how to implement either a surrogate or a TypeModel in
protobuf-net?
Original comment by ylos...@gmail.com
on 6 Jun 2011 at 6:12
k; as a first stab:
RuntimeTypeModel.Default.Add(typeof(Vector3), false).Add("X", "Y", "Z");
somewhere at startup registers Vector3, using fields 1,2,3 to serialize X,Y,Z
does that work?
Original comment by marc.gravell
on 6 Jun 2011 at 7:31
RuntimeTypeModel.Default.Add(typeof(Vector3), false).Add("X", "Y", "Z");
This works great!
Thanks for your help, and again thanks for porting this to .net!
Original comment by ylos...@gmail.com
on 6 Jun 2011 at 11:40
Original comment by marc.gravell
on 13 Jun 2011 at 8:26
Original issue reported on code.google.com by
ylos...@gmail.com
on 5 Jun 2011 at 11:19