Пример #1
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;
        }
Пример #2
0
        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;
            }
        }
Пример #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;
        }