Beispiel #1
0
        void ResTree_OnNodeRightsChanged(object sender, NodeRightsChangedEventArgs e)
        {
            // 令显示正确

            NodeInfo nodeinfo = null;

            for (int i = 0; i < this.Items.Count; i++)
            {
                ListViewItem item = this.Items[i];
                nodeinfo = (NodeInfo)item.Tag;

                if (nodeinfo == null)
                {
                    continue;
                }

                // nodeinfo由于和tree共享,所以内存是同步的,不用修改
                if (nodeinfo.TreeNode == e.Node)
                {
                    item.SubItems[1].Text = e.Rights;

                    if (nodeinfo.Rights == "")
                    {
                        item.ForeColor = SystemColors.GrayText; // ControlPaint.LightLight(nodeNew.ForeColor);
                    }
                    else
                    {
                        item.ForeColor = SystemColors.WindowText;
                    }
                }
            }
        }
Beispiel #2
0
        // 设置一个节点所包含的权限字符串
        public void SetNodeRights(TreeNode node,
                                  string strRights)
        {
            NodeInfo nodeinfo = (NodeInfo)node.Tag;

            if (nodeinfo.Rights == strRights)
            {
                return;
            }

            nodeinfo.Rights = strRights;

            if (nodeinfo.Rights == "" || nodeinfo.Rights == null)
            {
                node.ForeColor = SystemColors.GrayText; // ControlPaint.LightLight(nodeNew.ForeColor);
            }
            else
            {
                node.ForeColor = SystemColors.WindowText;
            }

            this.m_bChanged = true;

            if (OnNodeRightsChanged != null)
            {
                NodeRightsChangedEventArgs e = new NodeRightsChangedEventArgs();
                e.Node   = node;
                e.Rights = strRights;
                OnNodeRightsChanged(this, e);
            }
        }
Beispiel #3
0
        // 设置一个节点所包含的权限字符串
        public void SetNodeRights(TreeNode node,
            string strRights)
        {
            NodeInfo nodeinfo = (NodeInfo)node.Tag;

            if (nodeinfo.Rights == strRights)
                return;

            nodeinfo.Rights = strRights;

            if (nodeinfo.Rights == "" || nodeinfo.Rights == null)
                node.ForeColor = SystemColors.GrayText;	// ControlPaint.LightLight(nodeNew.ForeColor);
            else
                node.ForeColor = SystemColors.WindowText;

            this.m_bChanged = true;

            if (OnNodeRightsChanged != null)
            {
                NodeRightsChangedEventArgs e = new NodeRightsChangedEventArgs();
                e.Node = node;
                e.Rights = strRights;
                OnNodeRightsChanged(this, e);
            }
        }
Beispiel #4
0
 // editbox跟踪对象Tree上的修改
 private void treeView_resRightTree_OnNodeRightsChanged(object sender, NodeRightsChangedEventArgs e)
 {
     if (e.Node == this.treeView_resRightTree.SelectedNode)
     {
         if (this.textBox_objectRights_rights.Text != e.Rights)
             this.textBox_objectRights_rights.Text = e.Rights;
     }
 }
Beispiel #5
0
        void ResTree_OnNodeRightsChanged(object sender, NodeRightsChangedEventArgs e)
        {
            // 令显示正确

            NodeInfo nodeinfo = null;
            for (int i = 0; i < this.Items.Count; i++)
            {
                ListViewItem item = this.Items[i];
                nodeinfo = (NodeInfo)item.Tag;

                if (nodeinfo == null)
                    continue;

                // nodeinfo由于和tree共享,所以内存是同步的,不用修改
                if (nodeinfo.TreeNode == e.Node)
                {
                    item.SubItems[1].Text = e.Rights;

                    if (nodeinfo.Rights == "")
                        item.ForeColor = SystemColors.GrayText;	// ControlPaint.LightLight(nodeNew.ForeColor);
                    else
                        item.ForeColor = SystemColors.WindowText;
                }

            }

        }