public override string ToString() { string result = ""; Type imType = this.GetType(); FieldInfo[] fields = imType.GetFields(); foreach (FieldInfo field in fields) { result += (field.Name + " = " + field.GetValue(this) + " "); } return result; }