public void SetData(object instance, PropertyDescriptor property, PropertyEditorCell editor)
        {
            this.instance = instance;
            this.property = property;
            if (property == null)
            {
                this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal];
            }
            else
            {
                this.CellBackground = null;
            }

            visible = property != null?property.VisibleFor(instance) : true;

            sensitive = property != null?property.EnabledFor(instance) && property.VisibleFor(instance) : true;

            editorCell = editor;
        }
        void GroupData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererPropertyGroup rc = (CellRendererPropertyGroup)cell;

            rc.IsGroup = (bool)model.GetValue(iter, 2);
            rc.Text    = (string)model.GetValue(iter, 0);

            PropertyDescriptor prop = (PropertyDescriptor)model.GetValue(iter, 1);

            if (prop != null)
            {
                InstanceData idata = (InstanceData)model.GetValue(iter, 3);
                rc.SensitiveProperty = prop.EnabledFor(idata.Instance) && prop.VisibleFor(idata.Instance);
            }
            else
            {
                rc.SensitiveProperty = true;
            }
        }
Beispiel #3
0
        public void SetData(object instance, PropertyDescriptor property, PropertyEditorCell editor)
        {
            this.instance = instance;
            this.property = property;
            if (property == null)
                this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal];
            else
                this.CellBackground = null;

            visible = property != null ? property.VisibleFor (instance): true;
            sensitive = property != null ? property.EnabledFor (instance) && property.VisibleFor (instance): true;
            editorCell = editor;
        }