public void FillFields(object o) { ListFields.BeginUpdate(); ListFields.Items.Clear(); ListFields.DisplayMember = "Name"; if (o != null) { Type type = o.GetType(); while (type != null) { AddFields(type); type = type.BaseType; } } ListFields.EndUpdate(); }