Open GoogleCodeExporter opened 8 years ago
Correction: I am deserializing, not serializing.
Original comment by bits...@gmail.com
on 7 Aug 2010 at 6:27
Hi Mark,
I've attached a diff file (created using Subversion) that fixes this, but it
was just a quick hack.
Essentially, I made the SerializationCallback delegate accept an additional
parameter, that being the SerializationContext, since it appeared everywhere
callbacks were invoked the SerializationContext was available, and that seemed
like the correct place to piggyback a StreamingContext onto.
However, in the patch you will see these lines:
- callback = (SerializationCallback)Delegate.CreateDelegate(
- typeof(SerializationCallback), null, found);
+ callback = delegate(T instance, SerializationContext
context) { found.Invoke(instance, null); };
Is there a performance improvement when using Delegate.CreateDelegate()? I just
used the same style of declaration as used by CF2 just to get it to compile,
otherwise it failed at runtime to bind due to the additional StreamingContext
parameter.
I apologize for the ugliness of the patch.
Not sure if you want to support this, but if you do, it shouldn't be too much
effort to do it right :)
Original comment by bits...@gmail.com
on 7 Aug 2010 at 8:25
Attachments:
Original comment by marc.gravell
on 6 Sep 2010 at 6:20
Original issue reported on code.google.com by
bits...@gmail.com
on 7 Aug 2010 at 6:23