Exemplo n.º 1
0
        private static void addProperty(ColumnSelectForm form, ColumnTreeNode parent, PropertyDescriptor pinfo)
        {
            var    nodes = parent != null ? parent.Nodes : form.treeView.Nodes;
            Column c     = new Column();

            c.HeaderText = pinfo.Name;
            c.Visible    = true;
            c.Width      = 100;
            if (parent == null)
            {
                c.PropertyDescriptorPath = new PropertyDescriptorPath(pinfo);
            }
            else
            {
                c.PropertyDescriptorPath = new PropertyDescriptorPath(form.dataType, parent.Column.PropertyDescriptorPath.ToString() + "." + pinfo.Name);
            }
            ColumnTreeNode node = new ColumnTreeNode(c, form);

            if ((pinfo.PropertyType.IsClass || pinfo.PropertyType.IsInterface) &&
                !pinfo.PropertyType.IsStandard())
            {
                node.Nodes.Add(new GetPropertiesTreeNode());
            }

            nodes.Add(node);
        }
Exemplo n.º 2
0
        private void sidebar_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ColumnTreeNode node = e.Node as ColumnTreeNode;

            if (node.SubColumn == null)
            {
                return;
            }

            ItemsColumn c = Packages.InstantiateColumn(node.SubColumn, this);

            tabBar.CurrentTab.ColumnView.NavigateTo(c.GetTrail());
            tabBar.CurrentTab.ColumnView.Columns[0].Focus();
            tabBar.CurrentTab.ColumnView.ScrollToLastColumn();
        }