|
-
Mar 9th, 2005, 11:42 PM
#1
Thread Starter
Member
loop properties [resolve]
i have define aroubd 8 - 10 public properties in an class.
is there a way to list out the properties during runtime?
Please advise.
Last edited by pelican; Mar 10th, 2005 at 01:35 AM.
-
Mar 10th, 2005, 12:50 AM
#2
Re: loop properties
PHP Code:
public static void GetProperties(ref Type theType)
{
PropertyInfo[][0] pi_Properties = theType.GetProperties((BindingFlags.Public | BindingFlags.Instance));
PropertyInfo pi_PropertyItem;
foreach (int pi_PropertyItem in pi_Properties) {
Console.WriteLine(pi_PropertyItem.Name);
}
}
(converted from my vb.net example)
-
Mar 10th, 2005, 01:34 AM
#3
Thread Starter
Member
Re: loop properties
Thanks. it works
-
Mar 10th, 2005, 01:44 AM
#4
Re: loop properties [resolve]
Of course it does.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|