Ejemplo n.º 1
0
        public void LoadFrom(AssemblyGroup grp)
        {
            treeViewAdv1.BeginUpdate();

            try
            {
                while (treeViewAdv1.Columns.Count > 1)
                {
                    treeViewAdv1.Columns.RemoveAt(1);
                }

                while (treeViewAdv1.NodeControls.Count > 2)
                {
                    treeViewAdv1.NodeControls.RemoveAt(2);
                }

                treeViewAdv1.Model = new TreeModel();

                if ((grp != null) && (!grp.HasErrors))
                {
                    int divisor  = Math.Max(1, grp.Assemblies.Count);
                    int colWidth = Math.Max(1, (treeViewAdv1.ClientRectangle.Width - treeViewAdv1.Columns[0].Width - System.Windows.Forms.SystemInformation.VerticalScrollBarWidth - 5) / divisor);

                    int col = 0;
                    foreach (AssemblyDetail ad in grp.Assemblies)
                    {
                        TreeColumn tc = new TreeColumn();
                        tc.Header      = ad.Location;
                        tc.TooltipText = tc.Header;
                        tc.Width       = colWidth;
                        treeViewAdv1.Columns.Add(tc);

                        DetailChangeNodeControl dnc = new DetailChangeNodeControl(col++);
                        dnc.ParentColumn = tc;
                        dnc.DisplayHiddenContentInToolTip = true;
                        dnc.EditEnabled = false;
                        dnc.Trimming    = StringTrimming.EllipsisCharacter;

                        treeViewAdv1.NodeControls.Add(dnc);
                    }

                    treeViewAdv1.Model = new AssemblyGroupModel(grp);
                    //treeViewAdv1.Root.Children[0].Expand();
                }
            }
            finally
            {
                treeViewAdv1.EndUpdate();
            }
        }
Ejemplo n.º 2
0
        public void LoadFrom(AssemblyGroup grp)
        {
            treeViewAdv1.BeginUpdate();

            try
            {
                while (treeViewAdv1.Columns.Count > 1)
                {
                    treeViewAdv1.Columns.RemoveAt(1);
                }

                while (treeViewAdv1.NodeControls.Count > 2)
                {
                    treeViewAdv1.NodeControls.RemoveAt(2);
                }

                treeViewAdv1.Model = new TreeModel();

                if ((grp != null) && (!grp.HasErrors))
                {
                    int divisor = Math.Max(1, grp.Assemblies.Count);
                    int colWidth = Math.Max(1, (treeViewAdv1.ClientRectangle.Width - treeViewAdv1.Columns[0].Width - System.Windows.Forms.SystemInformation.VerticalScrollBarWidth - 5) / divisor);

                    int col = 0;
                    foreach (AssemblyDetail ad in grp.Assemblies)
                    {
                        TreeColumn tc = new TreeColumn();
                        tc.Header = ad.Location;
                        tc.TooltipText = tc.Header;
                        tc.Width = colWidth;
                        treeViewAdv1.Columns.Add(tc);

                        DetailChangeNodeControl dnc = new DetailChangeNodeControl(col++);
                        dnc.ParentColumn = tc;
                        dnc.DisplayHiddenContentInToolTip = true;
                        dnc.EditEnabled = false;
                        dnc.Trimming = StringTrimming.EllipsisCharacter;

                        treeViewAdv1.NodeControls.Add(dnc);
                    }

                    treeViewAdv1.Model = new AssemblyGroupModel(grp);
                    //treeViewAdv1.Root.Children[0].Expand();
                }
            }
            finally
            {
                treeViewAdv1.EndUpdate();
            }
        }