Results 1 to 4 of 4

Thread: loop properties [resolve]

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    59

    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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: loop properties

    PHP Code:
    public static void GetProperties(ref Type theType)
    {
     
    PropertyInfo[][0pi_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)

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    59

    Re: loop properties

    Thanks. it works

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width