Exemplo n.º 1
0
        public EditSession StartEditing(Gdk.Rectangle cell_area, StateType state)
        {
            IInspectorEditor ed = CreateEditor(cell_area, state);

            if (ed == null)
            {
                return(null);
            }
            return(new EditSession(container, obj, property, ed));
        }
Exemplo n.º 2
0
        public EditSession(Gtk.Widget container, object instance, PropertyDescriptor property, IInspectorEditor currentEditor)
        {
            this.property      = property;
            this.obj           = instance;
            this.container     = container;
            this.currentEditor = currentEditor;

            currentEditor.Initialize(this);
            if (instance != null)
            {
                currentEditor.Value = property.GetValue(instance);
            }

            currentEditor.ValueChanged += OnValueChanged;
        }
Exemplo n.º 3
0
        protected virtual IInspectorEditor CreateEditor(Gdk.Rectangle cell_area, StateType state)
        {
            if (DialogueEdit && (!property.IsReadOnly || EditsReadOnlyObject))
            {
                return(new InspectorDialogueEditor(this));
            }
            else
            {
                Type editorType = editorManager.GetEditorType(property);
                if (editorType == null)
                {
                    return(null);
                }

                IInspectorEditor editor = Activator.CreateInstance(editorType) as IInspectorEditor;
                if (editor == null)
                {
                    throw new Exception("The property editor '" + editorType + "' must implement the interface IInspectorEditor");
                }
                return(editor);
            }
        }