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); } }