private void _CheckForNodes(TreeListNodeCollection colItems) { bool bExistsJobs; foreach (TreeListNode tlnServer in colItems) { NodeData ndp = m_tlnProfile.Tag as NodeData; NodeData nds = tlnServer.Tag as NodeData; bExistsJobs = JobQueueCheck.ExistsCopyJobs(ndp.Type, nds.Data1, ndp.Data2); tlnServer.SubItems[4].Caption = bExistsJobs.ToString(); tlnServer.ImageIndex = _GetPictureIndex(tlnServer); // call recursiv _CheckForNodes(tlnServer.Nodes); } tlcServer.Invalidate(); }
private void _ThreadFunction() { bool bExistsJobs; try { List <TreeListNode> lNodes = new List <TreeListNode> (tlcProfile.Nodes.Count); lock (tlcProfile.Nodes.SyncRoot) { foreach (TreeListNode tlnProfile in tlcProfile.Nodes) { lNodes.Add(tlnProfile); } } foreach (TreeListNode tlnProfile in lNodes) { NodeData nds = m_tlnServer.Tag as NodeData; NodeData ndp = tlnProfile.Tag as NodeData; bExistsJobs = JobQueueCheck.ExistsCopyJobs(ndp.Type, nds.Data1, ndp.Data1); tlnProfile.SubItems[5].Caption = bExistsJobs.ToString(); tlnProfile.ImageIndex = _GetPictureIndex(tlnProfile); } tlcProfile.Invalidate(); } catch (Exception ex) { // do nothing because its our stupid thread Debug.WriteLine(ViException.ErrorString(ex)); } }