Home All Groups Group Topic Archive Search About
Author
17 Jan 2006 8:15 PM
Ronin
I'm trying to create a class and with in that class i want to access or
change the property statement by using "For" or "For each..." statement... is
this possible?

Please point me to the right direction if it is possible.

Please advice.


Thanks in advance.


Ros

Author
17 Jan 2006 8:36 PM
Mattias Sjögren
>I'm trying to create a class and with in that class i want to access or
>change the property statement

Which property statement? Can you post the code you have so far?


>by using "For" or "For each..." statement... is
>this possible?

If the property returns something that can be iterated over you can do
that, yes.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
17 Jan 2006 8:49 PM
Ronin
not the property itself...

i ment each individual property in a class... i looked at CollectionBase
Class, but i was not sure if it would return the property... write the
following statements

for each property in MyCollection
   'rest of the codes here
next

Show quoteHide quote
"Mattias Sjögren" wrote:

>
> >I'm trying to create a class and with in that class i want to access or
> >change the property statement
>
> Which property statement? Can you post the code you have so far?
>
>
> >by using "For" or "For each..." statement... is
> >this possible?
>
> If the property returns something that can be iterated over you can do
> that, yes.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>
Author
17 Jan 2006 9:16 PM
Mattias Sjögren
>i ment each individual property in a class... i looked at CollectionBase
>Class, but i was not sure if it would return the property... write the
>following statements
>
>for each property in MyCollection
>   'rest of the codes here
>next


I'm still not sure I fully understand what you're trying to do, but I
think you may be looking for reflection.

For Each pi As PropertyInfo In GetType().GetProperties()



Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
17 Jan 2006 10:51 PM
Ronin
thanks for the advice Mattias, i'll try that.


Thanks again.



Ros

Show quoteHide quote
"Mattias Sjögren" wrote:

> >i ment each individual property in a class... i looked at CollectionBase
> >Class, but i was not sure if it would return the property... write the
> >following statements
> >
> >for each property in MyCollection
> >   'rest of the codes here
> >next
>
>
> I'm still not sure I fully understand what you're trying to do, but I
> think you may be looking for reflection.
>
> For Each pi As PropertyInfo In GetType().GetProperties()
>
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>
Author
18 Jan 2006 9:09 AM
Cyril Gupta
Thank you Mattias, that helped me too :)

Cheers!
Cyril