Esempio n. 1
0
 public CTVControl(CheckboxTreeView ctv, Control controlPanel)
 {
     InitializeComponent();
     Dock = DockStyle.Fill;
     tableLayoutPanel.Controls.Add(controlPanel);
     tableLayoutPanel.Controls.Add(ctv, 0, 1);
 }
Esempio n. 2
0
 public CTVControl(CheckboxTreeView ctv)
     : this(ctv, new CTVControlPanel(ctv))
 {
 }
Esempio n. 3
0
 public CTVControlPanel(CheckboxTreeView ctv)
 {
     InitializeComponent();
     CTV = ctv;
 }
Esempio n. 4
0
        void PopulateIntervalTreeView(CheckboxTreeView treeView, IntervalTree tree)
        {
            lock (tree)
            {
                foreach (RailGroup rg in tree.Groups)
                {
                    TreeNode node = null;

                    string name = rg.Name;

                    if (!m_pathsInIntervalTree.ContainsKey(name))
                    {
                        TreeNodeCollection nodes = treeView.Nodes;

                        foreach (string location in name.PathLocations())
                        {
                            if (nodes.ContainsKey(location))
                            {
                                node = nodes[location];
                            }
                            else
                            {
                                node         = new TreeNode(location);
                                node.Name    = location;
                                node.Checked = true;
                                node.Tag     = rg;
                                nodes.Add(node);
                            }

                            nodes = node.Nodes;
                        }

                        m_pathsInIntervalTree.Add(name, node);
                    }
                    else
                    {
                        node = m_pathsInIntervalTree[name];
                    }

                    foreach (int railId in rg.Rails)
                    {
                        string   railName = tree.GetRailName(railId);
                        TreeNode railNode = node;

                        if (!m_pathsInIntervalTree.ContainsKey(railName))
                        {
                            TreeNodeCollection nodes = railNode.Nodes;

                            foreach (string location in railName.PathLocations())
                            {
                                if (nodes.ContainsKey(location))
                                {
                                    railNode = nodes[location];
                                }
                                else
                                {
                                    railNode         = new TreeNode(location);
                                    railNode.Name    = location;
                                    railNode.Checked = true;
                                    railNode.Tag     = new KeyValuePair <RailGroup, int>(rg, railId);
                                    nodes.Add(railNode);
                                }

                                nodes = railNode.Nodes;
                            }

                            m_pathsInIntervalTree.Add(railName, railNode);

                            /*
                             * TreeNode leafNode = new TreeNode(location);
                             * leafNode.Name = location;
                             * leafNode.Checked = true;
                             * leafNode.Tag = new KeyValuePair<RailGroup, int>(rg, railId);
                             * node.Nodes.Add(leafNode);
                             * m_pathsInIntervalTree.Add(location, leafNode);
                             */
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 public CheckStateScope(CheckboxTreeView ctv)
 {
     CTV = ctv;
     CTV.StartCheckStateBlock();
 }