Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: Exception form HRESULT 0*800AC472 Pin
dan!sh 1-Apr-11 22:14
professional dan!sh 1-Apr-11 22:14 
GeneralRe: Exception form HRESULT 0*800AC472 Pin
situ211-Apr-11 22:19
situ211-Apr-11 22:19 
GeneralRe: Exception form HRESULT 0*800AC472 Pin
Bernhard Hiller3-Apr-11 22:22
Bernhard Hiller3-Apr-11 22:22 
AnswerCross-post Pin
Wendelius1-Apr-11 22:18
mentorWendelius1-Apr-11 22:18 
AnswerRe: Exception form HRESULT 0*800AC472 Pin
Abhinav S3-Apr-11 7:20
Abhinav S3-Apr-11 7:20 
QuestionNeed help w/ custom serialization (specifically OnSerializing attribute) [modified] Pin
SledgeHammer011-Apr-11 14:03
SledgeHammer011-Apr-11 14:03 
AnswerRe: Need help w/ custom serialization (specifically OnSerializing attribute) Pin
Dave Kreskowiak1-Apr-11 15:21
mveDave Kreskowiak1-Apr-11 15:21 
GeneralRe: Need help w/ custom serialization (specifically OnSerializing attribute) Pin
SledgeHammer011-Apr-11 15:47
SledgeHammer011-Apr-11 15:47 
Yeah, sorry, I posted the wrong snippet.

It *is* OnSerializing. Fixed the original post. I was testing if OnSerialized was called. Its not. I saw on google that the XmlSerializer doesn't support those attributes. By "not work", I mean, I don't get a notification that somebody is serializing the object, so I don't have a chance to perform the lazy load and the serializer writes out an empty collection. The serializer is doing what its supposed to because the collection IS empty at that point. Thats kind of what this special collection does. It only loads the items when needed. So I was looking for something to hook into for the serialization so I know its time to load.

The work-arounds on google that I found were:

1) use BinaryFormatter or the soap formatter which support the attributes (yes, BF does work, but thats besides the point -- if the user wants to use XmlFormatter, they should be able to). Not an acceptable solution.

2) Implement ISerializable. This does get called with all the serializers, but its pretty much reimplementing serialization from the ground up. Really a last resort after I've exhausted every single other last resort.

I also have work-arounds myself: a) have the user call a property that forces the lazy load b) add a "forceload" method. I'd prefer to not do either of these and do it automatically Smile | :) .
GeneralRe: Need help w/ custom serialization (specifically OnSerializing attribute) Pin
Dave Kreskowiak1-Apr-11 17:10
mveDave Kreskowiak1-Apr-11 17:10 
GeneralRe: Need help w/ custom serialization (specifically OnSerializing attribute) Pin
SledgeHammer011-Apr-11 17:29
SledgeHammer011-Apr-11 17:29 
GeneralRe: Need help w/ custom serialization (specifically OnSerializing attribute) Pin
Dave Kreskowiak2-Apr-11 2:16
mveDave Kreskowiak2-Apr-11 2:16 
Questiona little help on "most used" codes ! Pin
_Q12_1-Apr-11 11:44
_Q12_1-Apr-11 11:44 
AnswerRe: a little help on "most used" codes ! Pin
jschell1-Apr-11 12:03
jschell1-Apr-11 12:03 
GeneralRe: a little help on "most used" codes ! Pin
_Q12_1-Apr-11 20:29
_Q12_1-Apr-11 20:29 
GeneralRe: a little help on "most used" codes ! Pin
jschell4-Apr-11 8:11
jschell4-Apr-11 8:11 
GeneralRe: a little help on "most used" codes ! Pin
_Q12_4-Apr-11 18:40
_Q12_4-Apr-11 18:40 
GeneralRe: a little help on "most used" codes ! Pin
Michael900017-Apr-11 21:02
Michael900017-Apr-11 21:02 
GeneralRe: a little help on "most used" codes ! Pin
_Q12_18-Apr-11 0:06
_Q12_18-Apr-11 0:06 
GeneralRe: a little help on "most used" codes ! Pin
Michael900018-Apr-11 12:16
Michael900018-Apr-11 12:16 
AnswerRe: a little help on "most used" codes ! Pin
PIEBALDconsult1-Apr-11 14:39
mvePIEBALDconsult1-Apr-11 14:39 
JokeRe: a little help on "most used" codes ! Pin
loyal ginger1-Apr-11 17:51
loyal ginger1-Apr-11 17:51 
GeneralRe: a little help on "most used" codes ! Pin
_Q12_1-Apr-11 20:52
_Q12_1-Apr-11 20:52 
AnswerRe: a little help on "most used" codes ! Pin
Luc Pattyn1-Apr-11 16:31
sitebuilderLuc Pattyn1-Apr-11 16:31 
GeneralRe: a little help on "most used" codes ! Pin
_Q12_1-Apr-11 21:12
_Q12_1-Apr-11 21:12 
AnswerRe: a little help on "most used" codes ! Pin
dan!sh 1-Apr-11 21:19
professional dan!sh 1-Apr-11 21:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.