private void SetterDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererToggle toggleRenderer = cell as CellRendererToggle;
            ColumnContainer    container      = model.GetValue(iter, columnObj) as ColumnContainer;

            toggleRenderer.Active = container.HasSetter;
        }
        private void PropNameDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererText textRenderer = cell as CellRendererText;
            ColumnContainer  container    = model.GetValue(iter, columnObj) as ColumnContainer;

            textRenderer.Text = container.PropertyName;
        }
Beispiel #3
0
        private void NullableDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererToggle toggleRenderer = cell as CellRendererToggle;
            ColumnContainer    container      = model.GetValue(iter, columnObj) as ColumnContainer;

            toggleRenderer.Active = container.ColumnSchema.IsNullable;
        }
        private void SetterToggled(object sender, ToggledArgs args)
        {
            TreeIter iter;

            if (store.GetIterFromString(out iter, args.Path))
            {
                ColumnContainer container = store.GetValue(iter, columnObj) as ColumnContainer;
                container.HasSetter = !container.HasSetter;
            }
        }
        private void PropTypeDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererText textRenderer = cell as CellRendererText;
            ColumnContainer  container    = model.GetValue(iter, columnObj) as ColumnContainer;
            DataTypeSchema   dt           = container.ColumnSchema.DataType;

            ISchemaProvider provider = dt.SchemaProvider;
            Type            type     = dt.DotNetType;

            textRenderer.Text = type.Name;
        }
        private void FieldNameEdited(object sender, EditedArgs args)
        {
            Gtk.TreeIter iter;
            if (store.GetIterFromString(out iter, args.Path))
            {
                ColumnContainer container = store.GetValue(iter, columnObj) as ColumnContainer;

                if (args.NewText != null && args.NewText.Length > 0)
                {
                    container.FieldName = args.NewText;
                }
                else
                {
                    //restore old name if new one is empty
                    (sender as CellRendererText).Text = container.FieldName;
                }
            }
        }