Open GoogleCodeExporter opened 9 years ago
Thanks; an interesting patch. What types/use-cases did you have in mind for
this?
One of the problems with that approach is that it doesn't apply to all the
frameworks that protobuf-net currently targets. I wonder if long-term, the "v2"
support for proxy types via conversion operators is a better option.
Original comment by marc.gravell
on 29 Jul 2010 at 5:55
I use it to serialize WPF Color structs as integers on my web template designer
site at http://cooltemplate.com
Done another way for V2 would be great, I just couldn't afford to wait for it
any longer.
Original comment by bryanliv...@gmail.com
on 8 Sep 2010 at 4:41
Marc, did you already find another way to do this? I would also like to send
Windows.Media.Color properties.
Thanks, Erik
Original comment by Erik.Vul...@gmail.com
on 25 May 2011 at 9:49
@Erik - the simplest way to do this remains being simply adding a separate
property that formats/parses the data in whatever way you choose, and mark the
*second* property for serialization. This property can be private for regular
.NET.
In v2, I've added 2 examples of doing this in v2, here:
http://code.google.com/p/protobuf-net/source/browse/trunk/Examples/Issues/Issue1
24.cs
(you can apply this to the RuntimeTypeModel.Default too, which works with the
static methods, but I needed separate models for 2 different tests)
Original comment by marc.gravell
on 26 May 2011 at 9:36
@Erik - the simplest way to do this remains being simply adding a separate
property that formats/parses the data in whatever way you choose, and mark the
*second* property for serialization. This property can be private for regular
.NET.
In v2, I've added 2 examples of doing this in v2, here:
http://code.google.com/p/protobuf-net/source/browse/trunk/Examples/Issues/Issue1
24.cs
(you can apply this to the RuntimeTypeModel.Default too, which works with the
static methods, but I needed separate models for 2 different tests)
Original comment by marc.gravell
on 26 May 2011 at 9:36
@Marc - thanks for the tip. I already implemented a similar solution (using a
byte[] of size 4), but it's good to know that it can also be a private
property.
Original comment by Erik.Vul...@gmail.com
on 27 May 2011 at 1:10
That example looks awesome! Can't wait until V2 ships so that I can use it.
Thanks again for all your hard work Marc!
Original comment by bryanliv...@gmail.com
on 8 Jun 2011 at 11:03
v2 is available for download (albeit marked beta) *now*. The "beta" branding is
mainly due to needing to add the side services (GetProto, extension-data etc).
The core is stable.
Original comment by marc.gravell
on 9 Jun 2011 at 11:26
Original issue reported on code.google.com by
bryanliv...@gmail.com
on 28 Jul 2010 at 9:11Attachments: