Exemple #1
0
 void Node_ValueChanged(object sender, EventArgs e)
 {
     if (treeViewAdv_data.InvokeRequired)
     {
         OnValueCallback d = new OnValueCallback(Node_ValueChanged);
         if (!this.Disposing)
         {
             this.Invoke(d, new object[] { sender, e });
         }
     }
     else
     {
         ((sender as NodeData).ValueTag as ListViewItem).SubItems[2].Text = (sender as NodeData).StringValue;
         //treeViewAdv_data.Invalidate(((sender as NodeData).ValueTag as ListViewItem).SubItems[2].Bounds);
     }
 }
Exemple #2
0
 void Node_StateChanged(object sender, EventArgs e)
 {
     if (treeView1.InvokeRequired)
     {
         OnValueCallback d = new OnValueCallback(Node_StateChanged);
         if (!this.Disposing)
         {
             this.Invoke(d, new object[] { sender, e });
         }
     }
     else
     {
         NodeBase b = (sender as NodeBase);
         if (b.Tag is TreeNode)
         {
             TreeNode tn        = (b.Tag as TreeNode);
             int      firsticon = 0;
             if (b.GetType() == typeof(NodeLN))
             {
                 firsticon = 5;
             }
             else if (b.GetType() == typeof(NodeFC))
             {
                 firsticon = 6;
             }
             else if (b.GetType() == typeof(NodeData))
             {
                 if (b.GetChildNodes().Length == 0)
                 { // Leaf
                     firsticon = 8;
                 }
                 else
                 {
                     firsticon = 7;
                 }
             }
             tn.ImageIndex         = firsticon + ((int)b.NodeState) * 4;
             tn.SelectedImageIndex = firsticon + ((int)b.NodeState) * 4;
             treeView1.Invalidate(tn.Bounds);
         }
     }
 }
Exemple #3
0
 void Node_StateChanged(object sender, EventArgs e)
 {
     if (treeViewIed.InvokeRequired)
     {
         OnValueCallback d = new OnValueCallback(Node_StateChanged);
         if (!this.Disposing)
         {
             this.Invoke(d, new object[] { sender, e });
         }
     }
     else
     {
         NodeBase b         = (sender as NodeBase);
         int      firsticon = 0;
         if (b is NodeLN)
         {
             firsticon = 5;
         }
         else if (b is NodeFC)
         {
             firsticon = 6;
         }
         else if (b is NodeDO)
         {
             firsticon = 7;
         }
         else if (b is NodeData && !(b is NodeDO))
         {
             firsticon = 8;
         }
         else if (b is NodeRCB)
         {
             if ((b as NodeRCB).isBuffered)
             {
                 firsticon = 33;
             }
             else
             {
                 firsticon = 32;
             }
         }
         else if (b is NodeVL)
         {
             firsticon = 34;
         }
         else if (b is NodeVLM)
         {
             firsticon = 35;
         }
         int newIconIndex = firsticon + ((int)b.NodeState) * 4;
         if (b.Tag is TreeNode)
         {
             TreeNode tn = (b.Tag as TreeNode);
             if (tn.ImageIndex != newIconIndex)
             {
                 tn.ImageIndex         = newIconIndex;
                 tn.SelectedImageIndex = newIconIndex;
                 treeViewIed.Invalidate(tn.Bounds);
             }
         }
         if (b.TagR is TreeNode)
         {
             TreeNode tn = (b.TagR as TreeNode);
             if (tn.ImageIndex != newIconIndex)
             {
                 tn.ImageIndex         = newIconIndex;
                 tn.SelectedImageIndex = newIconIndex;
                 treeViewIed.Invalidate(tn.Bounds);
             }
         }
     }
 }