.net - Visual Studio: Detect type presence in a container -


i have following situation: serialization of object: mybocontainer.

it throws me serialization errors "the class myuielement not marked serializable".

normally, shouldn't have such class between mybocontainer elements(or children). however, have public list<object> , theoretically possible.

question:
how can test in debug mode in vs if instance of object mybocontainer contains(deepsearch) or not instances of myquerytestclass type?

if can't predict data is, imo shouldn't serializing element.

since appears using binaryformatter, perhaps add [nonserialized]:

[nonserialized] private list<object> foo = ... 

also, events usual cause of confusion on this; annotate events, too:

[field:nonserialized] public event eventhandler somecrazyevent; 

or if doing explicit event implementations, set [nonserialized] on whatever backing field holding delegate or eventhandlerlist.

(well, strictly speaking wouldn't using binaryformatter in first place - using serialize isn't tied internal class structure can thing; rant day...)


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -