473,473 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Check if a class member is a collection or array

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

--
Ceers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------
Nov 20 '05 #1
2 1265
In article <uW**************@TK2MSFTNGP11.phx.gbl>, Crirus wrote:
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...

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2
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

--
Ceers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

"Tom Shelton" <to*@mtogden.com> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
In article <uW**************@TK2MSFTNGP11.phx.gbl>, Crirus wrote:
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...

--
Tom Shelton
MVP [Visual Basic]

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shannon Rotz | last post by:
I'm just learning how to use class modules in Access (2000 or XP). So far, I've created two classes, with the data manipulation for the corresponding tables encapsulated inside each of them ...
24
by: downwitch | last post by:
Hi, I know this has been covered here and in the .public groups, but it seems like it's been a while, especially around here, so I just thought I'd ask again to see if anyone has figured out a...
4
by: Glen | last post by:
Hello, Can anyone tell me if there is a way to enumerate a member collection for a protected class? For example, the Cursors class is protected and must be called directly, but it does not...
5
by: Oberon | last post by:
I want to create a collection of records which will be permanently available at the application level in an ASP.NET application. How should I go about that? Lets say that the record structure...
11
by: Larry | last post by:
is there a way to add a class property an run-time? If so, how? any code samples? *** Sent via Developersdex http://www.developersdex.com ***
4
by: Marc Castrechini | last post by:
Forgive any bad terms. New to .Net development My business layer has something similiar to this class Accoun private m_Notes as Note( ' Get Mehod .. end clas
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
8
by: Per Bull Holmen | last post by:
Hey Im new to c++, so bear with me. I'm used to other OO languages, where it is possible to have class-level initialization functions, that initialize the CLASS rather than an instance of it....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.