开发者

protobuf-net equivalent for the StreamingContext

I'm translating some code from the DataContractSerializer to the impressive protobuf-net serializer, and one thing that I'm really missing is the StreamingContext passed through to my OnDeseriali开发者_如何学JAVAzing methods. I'd really like to find a way to pass a bit of context information through to some of my objects during their deserialization.

My question: is this usage pattern supported in protobuf-net? I haven't found an equivalent so far in my investigation of its APIs, but I'm not very familiar with its design so may have overlooked something.


The signature with a StreamingContext is supported, but it does not currently include the .Context (it currently just announces StreamingContextStates.Persistence with .Context = null), if that is what you mean.I could support that by adding an overload to the serialize/deserialize methods - presumably that would solve it?

If so, please log a feature request on the project site. Since it already supports StreamingContext in this scenario, it doesn't sound hard.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜