I have accomplished something similar by using Reflection, however I don't think you can actually loop through all of your classes without indicating at least their names.
Code:
using System;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
Person person = new Person();
person.Age = 27;
person.Name = "Fernando Vezzali";
Type type = typeof(Person);
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo property in properties)
{
Console.WriteLine("{0} = {1}", property.Name, property.GetValue(person, null));
}
Console.Read();
}
}
Person Class:
class Person
{
private int age;
private string name;
public int Age
{
get { return age; }
set { age = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
}
Reference: http://wiki.asp.net/page.aspx/474/how-to-iterate-through-all-properties-of-a-class/
Good luck!