Exemplo n.º 1
0
        private void advTree1_CellSelected(object sender, AdvTreeCellEventArgs e)
        {
            List<String> items = (List<String>)e.Cell.Tag;

            if (items == null) return;

            this.labelX1.Text = Convert.ToString(items[1].ToString()).Replace("<br>", "<br/>");
        }
Exemplo n.º 2
0
        private void advTree1_AfterCheck(object sender, DevComponents.AdvTree.AdvTreeCellEventArgs e)
        {
            this.advTree1.AfterCheck -= advTree1_AfterCheck;

            Node node = e.Cell.Parent;

            //级联更改子节点状态
            this.SetChildCheck(node);

            //更新父节点状态
            this.SetParentCheck(node);

            this.advTree1.AfterCheck += advTree1_AfterCheck;
        }
        /// <summary>
        /// Called when a layer visibility checkbox state is changed
        /// </summary>
        void toggleLayerVisibility(object sender, AdvTreeCellEventArgs e)
        {
            if (world == null)
                return;

            world.ToggleLayer(selectedForWorld, e.Cell.Checked);
            world.InvalidateCanvas();
        }
Exemplo n.º 4
0
 private void rackAdvTree_AfterCheck(object sender, AdvTreeCellEventArgs e)
 {
     foreach(Node baseNode in rackAdvTree.Nodes)
     {
         foreach(Node rootNode in baseNode.Nodes)
         {
             Rack rack = (Rack)rootNode.Tag;
             rack.IsTested = rootNode.Checked;
         }
     }
     testedRacks.SaveThis();
 }
Exemplo n.º 5
0
 /// <summary>
 /// 勾选基础操作选项
 /// </summary>
 /// <param name="sender">事件发送者</param>
 /// <param name="e">事件参数</param>
 private void commonOperationTree_AfterCheck(object sender, AdvTreeCellEventArgs e)
 {
     if (beginEdit)
     {
         groupContentChanged = true;
     }            
 }
Exemplo n.º 6
0
        /// <summary>
        /// 勾选基础授权选项
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void commonAuthorityTree_AfterCheck(object sender, AdvTreeCellEventArgs e)
        {
            if (beginEdit)
            {
                Node currentNode = commonAuthorityTree.SelectedNode;

                if (currentNode != null)
                {
                    if (currentNode.Level == 0)
                    {
                        foreach (Node node in currentNode.Nodes)
                        {
                            node.Checked = currentNode.Checked;
                        }
                    }                    

                    if (currentNode.CheckBoxVisible && currentNode.Checked) // 自动勾选父结点
                    {
                        beginEdit = false;
                        Node parentNode = currentNode.Parent;

                        while (parentNode != null)
                        {
                            if (parentNode.CheckBoxVisible)
                            {
                                parentNode.Checked = true;
                            }

                            parentNode = parentNode.Parent;
                        }

                        beginEdit = true;
                    } 
                }

                groupContentChanged = true;
            }                                    
        }
Exemplo n.º 7
0
        /// <summary>
        /// 勾选高级授权选项
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="e">事件参数</param>
        private void advanceAuthorityTree_AfterCheck(object sender, AdvTreeCellEventArgs e)
        {
            if (beginEdit)
            {
                Node currentNode = advanceAuthorityTree.SelectedNode;

                if (currentNode != null)
                {
                    switch (currentNode.Level)
                    {
                        case 0:
                            {
                                foreach (Node node in currentNode.Nodes)
                                {
                                    node.Checked = currentNode.Checked;

                                    Node lastNode = node.LastNode;

                                    foreach (Node childNode in lastNode.Nodes)
                                    {
                                        childNode.Checked = currentNode.Checked;
                                    }
                                }

                                break;
                            }
                        case 1:
                            {
                                Node lastNode = currentNode.LastNode;

                                foreach (Node childNode in lastNode.Nodes)
                                {
                                    childNode.Checked = currentNode.Checked;
                                }

                                break;
                            }
                    }

                    if (currentNode.CheckBoxVisible && currentNode.Checked) // 自动勾选父结点
                    {
                        beginEdit = false;
                        Node parentNode = currentNode.Parent;

                        while (parentNode != null)
                        {
                            if (parentNode.CheckBoxVisible)
                            {
                                parentNode.Checked = true;
                            }

                            parentNode = parentNode.Parent;
                        }

                        beginEdit = true;
                    }                    
                }

                groupContentChanged = true;
            }
            
        }
Exemplo n.º 8
0
 private void treeList_AfterCheck(object sender, AdvTreeCellEventArgs e)
 {
     if (e.Cell.Parent.Tag is ScriptBase)
     {
         ScriptBase scriptBase = (ScriptBase)e.Cell.Parent.Tag;
         scriptBase.Enabled = e.Cell.Parent.Checked;
     }
     else if (e.Cell.Parent.Tag.GetType().GetProperty("Enabled") != null)
     {
         PropertyInfo prop = e.Cell.Parent.Tag.GetType().GetProperty("Enabled");
         prop.GetSetMethod().Invoke(e.Cell.Parent.Tag, new object[] { false });
     }
     ValidateNode(e.Cell.Parent);
 }