public class _you_name_it_
{
public string Name;
public string CarType;
public string CarColor;
public int Age;
public string Another_Attribute;
public override string ToString()
{
return string.Format ("Name: {0} CarType: {1} CarColour: {3} Age: {4}",
Name, CarType, CarColor, Age );
}
}
Use it as
System.Collections.Generic.Dictionary<string,_you_name_it_> myList= new
System.Collections.Generic.Dictionary<string,_you_name_it_>();
_you_name_it_ dummy = new _you_name_it_();
dummy.Name = "John";
dummy.CarType = "Honda";
dummy.CarColor = "Green";
dummy.Age = 40;
myList[dummy.Name]=dummy;
MessageBox.Show(myList["John"].ToString());