示例#1
0
 private void backBuildTree_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
 {
     object[] lists = (object[])e.Result;
     tvNodes.BeginUpdate();
     try
     {
         tvNodes.Nodes.Clear();
         for (int i = 1; i <= 8; i++)
         {
             List <string> list = (List <string>)lists[i - 1]; //Data.GetClients(i);
             if (list.Count > 0)
             {
                 KD       kd = getVals(list[0]);
                 TreeNode nd = tvNodes.Nodes.Add(i + ". " + kd.Descriptor);
                 nd.Tag = kd.Key;
                 for (int j = 1; j < list.Count; j++)
                 {
                     kd = getVals(list[j]);
                     nd.Nodes.Add(kd.Descriptor).Tag = kd.Key;
                 }
                 nd.Expand();
             }
         }
     }
     finally
     {
         tvNodes.EndUpdate();
     }
     RestoreTreePos(lastname);
     if (tvNodes.SelectedNode == null)
     {
         lvFetchList.Items.Clear();
     }
 }
示例#2
0
        private KD getVals(string value)
        {
            KD kd = new KD();

            string[] items = value.Split(new char[] { '=' });
            kd.Key        = items[0];
            kd.Descriptor = (items.Length == 2) ? items[1] : String.Empty;
            return(kd);
        }