예제 #1
0
        public EditSession StartEditing(Gdk.Rectangle cell_area, StateType state)
        {
            IPropertyEditor ed = CreateEditor(cell_area, state);

            if (ed == null)
            {
                return(null);
            }
            ed.Initialize(property);
            if (obj != null)
            {
                ed.AttachObject(obj);
                ed.Value = property.GetValue(obj);
            }
            return(new EditSession(container, obj, property, ed));
        }
예제 #2
0
        public void AttachObject(object ob)
        {
            if (ob == null)
            {
                throw new ArgumentNullException("ob");
            }

            syncing  = true;
            this.obj = ob;
            currentEditor.AttachObject(obj);

            // It is the responsibility of the editor to convert value types
            object initial = property.GetValue(obj);

            currentEditor.Value = initial;

            syncing = false;
        }