Example #1
0
 private void AfterThreeStateCheck(object sender, JetBrains.UI.Components.CustomTreeView.ThreeStateCheckEventArgs e)
 {
     foreach (TreeNode node in _resourceTreeView.Nodes)
     {
         if (_resourceTreeView.GetNodeCheckState(node) == NodeCheckState.Checked)
         {
             _btnSend.Enabled = true;
             return;
         }
     }
     _btnSend.Enabled = false;
 }
Example #2
0
        private void AfterThreeStateCheck(object sender, JetBrains.UI.Components.CustomTreeView.ThreeStateCheckEventArgs e)
        {
            SerializableTag nodeTag = (SerializableTag)e.Node.Tag;

            if (nodeTag.TreeNodeType == SerializableTag.Type.Link)
            {
                NodeCheckState curState = _resourceTreeView.GetNodeCheckState(e.Node);
                nodeTag.AcceptSending = (curState == NodeCheckState.Checked);
                foreach (TreeNode treeNode in e.Node.Nodes)
                {
                    SetNodeCheckState(treeNode, curState);
                }
            }
            else if (nodeTag.TreeNodeType == SerializableTag.Type.LinkedResource)
            {
                nodeTag.AcceptSending = (_resourceTreeView.GetNodeCheckState(e.Node)) == NodeCheckState.Checked;
                TreeNode parentNode     = e.Node.Parent;
                bool     thereChecked   = false;
                bool     thereUnchecked = false;
                foreach (TreeNode treeNode in parentNode.Nodes)
                {
                    NodeCheckState curState = _resourceTreeView.GetNodeCheckState(treeNode);
                    if (curState == NodeCheckState.Checked)
                    {
                        thereChecked = true;
                    }
                    else if (curState == NodeCheckState.Unchecked)
                    {
                        thereUnchecked = true;
                    }
                    if (thereChecked && thereUnchecked)
                    {
                        SetNodeCheckState(parentNode, NodeCheckState.Grayed);
                        break;
                    }
                }
                if (thereChecked && !thereUnchecked)
                {
                    SetNodeCheckState(parentNode, NodeCheckState.Checked);
                }
                if (!thereChecked && thereUnchecked)
                {
                    SetNodeCheckState(parentNode, NodeCheckState.Unchecked);
                }
            }
            _fileLength.Text = _resourceSerializer.GenerateXML(ResourceSerializer.ResourceTransferFileName).ToString();
        }