C# 使用委托

 private delegate void AddstudyDescriptionNodeDelegate(string studyDescription, string studyUID);


        private void AddstudyDescriptionNode(string studyDescription, string studyUID)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new AddstudyDescriptionNodeDelegate(AddstudyDescriptionNode), studyDescription, studyUID);
                return;
            }
            TreeNode Root = treeView1.Nodes.Find("Root", true).Single();
            if (!Root.Nodes.ContainsKey(studyUID))
            {

                TreeNode root = new TreeNode(studyDescription);
                root.Name = studyUID;

                Root.Nodes.Add(root);
            }
        }

 

posted @ 2013-01-28 17:02  louiskoo  阅读(183)  评论(0编辑  收藏  举报