Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hey, is this where I'm gonna use REFLECTION?
Message
From
19/11/2003 15:24:07
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Hey, is this where I'm gonna use REFLECTION?
Miscellaneous
Thread ID:
00851624
Message ID:
00851624
Views:
54
I think I've been waiting for this day.

I have the name of a public property stored to a private field. I want to obtain the value stored in the public property. How can I evaluate the contents of the private field to query the correct public property?

Here's an example of what I'm trying to do:
public class Class1
{
   private string Property_Name = "MyValue";
   
   public string MyValue
   {
      get
      {
         return "Radiohead"
      }
   }
   
   public void ShowPropertyValue()
   {
      Console.WriteLine("The value of {0} is {1}",
         this.Property_Name,
         <<WHAT GOES HERE??>>);
   }
}
Note the "WHAT GOES HERE??" in the ShowPropertyValue() method.

Note too that I'm going to need to *reverse* this operation - store a new value to the specified property.

Thanks.
>>-Steve->>

Steve Sawyer
Geeks and Gurus, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform