Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }