Click here to Skip to main content
16,012,468 members

Comments by Jonathon Bolster (Top 2 by date)

Jonathon Bolster 16-Dec-11 15:40pm View    
Deleted
In which case, congrats (and thanks)! Keep it up. Especially with something like this little gem. There are some very specific uses for needing to get a property name as a string but it's posts like this that make people happy for the developer community.
Jonathon Bolster 16-Dec-11 10:14am View    
Deleted
Sometimes you have to use a string. For example, I use NHibernate in my application. One of the events allows me to view a list of the properties that have changed in an update and this list is a string array. So in order to find the index, I use a similar method to get the property name as a string. This means I don't have to hard code "MyPropertyName" as a string (which will cause it to break without any checking if I was to change it to "MyNewPropertyName"). By using a method like this tip, the compiler will throw up an error because it will know that myclass.MyProperty doesn't exist.