Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Running a form in a diferent Thread Pin
oscarderooij13-May-08 3:25
oscarderooij13-May-08 3:25 
GeneralRe: Running a form in a diferent Thread Pin
Luc Pattyn13-May-08 3:45
sitebuilderLuc Pattyn13-May-08 3:45 
GeneralRe: Running a form in a diferent Thread Pin
oscarderooij13-May-08 3:28
oscarderooij13-May-08 3:28 
GeneralRe: Running a form in a diferent Thread Pin
Luc Pattyn13-May-08 3:40
sitebuilderLuc Pattyn13-May-08 3:40 
GeneralRe: Running a form in a diferent Thread Pin
oscarderooij15-May-08 7:45
oscarderooij15-May-08 7:45 
QuestionForeach property in myClass Pin
Harvey Saayman5-May-08 3:57
Harvey Saayman5-May-08 3:57 
AnswerRe: Foreach property in myClass Pin
Colin Angus Mackay5-May-08 4:04
Colin Angus Mackay5-May-08 4:04 
AnswerRe: Foreach property in myClass Pin
S. Senthil Kumar5-May-08 4:06
S. Senthil Kumar5-May-08 4:06 
Reflection is your friend.

foreach (PropertyInfo propertyInfo in this.GetType().GetProperties())
{
   Console.WriteLine(propertyInfo.Name + "=" + propertyInfo.GetValue(this, null));
}

You can use the other overload for GetProperties to get non-public and non-static properties as well.

That said, I'd be worried if I had hundreds of properties in a class.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

GeneralRe: Foreach property in myClass Pin
Harvey Saayman5-May-08 4:12
Harvey Saayman5-May-08 4:12 
GeneralRe: Foreach property in myClass Pin
carbon_golem5-May-08 5:01
carbon_golem5-May-08 5:01 
GeneralRe: Foreach property in myClass Pin
Nouman Bhatti5-May-08 4:07
Nouman Bhatti5-May-08 4:07 
AnswerRe: Foreach property in myClass Pin
Yevgen Lisovenko5-May-08 4:07
Yevgen Lisovenko5-May-08 4:07 
AnswerRe: Foreach property in myClass Pin
Ennis Ray Lynch, Jr.5-May-08 10:30
Ennis Ray Lynch, Jr.5-May-08 10:30 
QuestionCrystal Reports Pin
GermanDM5-May-08 3:51
GermanDM5-May-08 3:51 
QuestionPass DataGridView to a UserControl Pin
mariusth5-May-08 3:51
mariusth5-May-08 3:51 
QuestionThreading question Pin
kensai5-May-08 3:48
kensai5-May-08 3:48 
AnswerRe: Threading question Pin
carbon_golem5-May-08 4:05
carbon_golem5-May-08 4:05 
AnswerRe: Threading question Pin
S. Senthil Kumar5-May-08 4:11
S. Senthil Kumar5-May-08 4:11 
GeneralRe: Threading question Pin
kensai5-May-08 21:28
kensai5-May-08 21:28 
Questionrunning script using Sqlcmd Pin
Denver Thomas5-May-08 3:45
Denver Thomas5-May-08 3:45 
QuestionInvalid Cast Problem using Enterprise Library MS DAAB (with dynamic dll loading) Pin
Pankaj Chamria5-May-08 3:21
Pankaj Chamria5-May-08 3:21 
QuestionAdding Active Directory Users to local Groups Pin
André Stroebel5-May-08 3:05
André Stroebel5-May-08 3:05 
AnswerRe: Adding Active Directory Users to local Groups Pin
André Stroebel5-May-08 3:26
André Stroebel5-May-08 3:26 
QuestionDataGridView Selection Pin
stancrm5-May-08 3:03
stancrm5-May-08 3:03 
AnswerRe: DataGridView Selection Pin
Csharp™5-May-08 10:46
Csharp™5-May-08 10:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.