Check if a class member is a collection or array

C

Crirus

I have some question related to the other post about iteration on a class
members.

I had found a way to figure out when a member of my class is array so I can
pull out it's elements to iterate on that classes members, recursively
I designed a Strong type class, inherited from CollectionBase.
My class have a member of that type, so it contain lots of references fo
objects of that strong type.

Is there a general way to figure out that a class member is in fact a bunch
of another references, not a primitive type or a single type?

What are all the types that can hold multiple references in NET?

How MS do serialise on this kind of members, that are in fact references on
another objects, bundled together in a collection?

Thanks
 
T

Tom Shelton

I have some question related to the other post about iteration on a class
members.

I had found a way to figure out when a member of my class is array so I can
pull out it's elements to iterate on that classes members, recursively
I designed a Strong type class, inherited from CollectionBase.
My class have a member of that type, so it contain lots of references fo
objects of that strong type.

Is there a general way to figure out that a class member is in fact a bunch
of another references, not a primitive type or a single type?

What are all the types that can hold multiple references in NET?

How MS do serialise on this kind of members, that are in fact references on
another objects, bundled together in a collection?

Thanks

I don't really now if there is a general way... You would probably have
to check and see what interfaces (IList, ICollection, IEnumerable, etc)
the class implements...

I have to ask - if these are custom classes, is there some reason that
you can't mark them serializable and then let the runtime take care of
it? Just curious...
 
C

Crirus

Because I need another kind of serialisation, not that provided by net...
Look at that thread: Iterate through members of a class.....
I posted there what I achieved so farr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top