public PropertyEditor AddEditorForField(FieldInfo field) { PropertyEditor e = this.AutoCreateMemberEditor(field); if (e == null) { e = this.ParentGrid.CreateEditor(field.FieldType, this); } if (e == null) { return(null); } e.BeginUpdate(); e.Getter = this.CreateFieldValueGetter(field); e.Setter = this.CreateFieldValueSetter(field); e.PropertyName = field.Name; e.EditedMember = field; this.AddPropertyEditor(e); this.ParentGrid.ConfigureEditor(e); e.EndUpdate(); return(e); }
public PropertyEditor AddEditorForProperty(PropertyInfo prop) { PropertyEditor e = this.AutoCreateMemberEditor(prop); if (e == null) { e = this.ParentGrid.CreateEditor(prop.PropertyType, this); } if (e == null) { return(null); } e.BeginUpdate(); e.Getter = this.CreatePropertyValueGetter(prop); e.Setter = prop.CanWrite ? this.CreatePropertyValueSetter(prop) : null; e.PropertyName = prop.Name; e.EditedMember = prop; this.AddPropertyEditor(e); this.ParentGrid.ConfigureEditor(e); e.EndUpdate(); return(e); }