/// <summary> /// Updates the count column (Thread safe) /// </summary> /// <param name="match">MatchResult that contains updated information</param> /// <history> /// [Curtis_Beard] 11/21/2005 Created /// </history> private void UpdateHitCount(MatchResult match) { // Makes this a thread safe operation if (lstFileNames.InvokeRequired) { UpdateHitCountCallBack del = new UpdateHitCountCallBack(UpdateHitCount); lstFileNames.Invoke(del, new object[1] { match }); return; } // find correct item to update foreach (ListViewItem item in lstFileNames.Items) { if (int.Parse(item.SubItems[Constants.COLUMN_INDEX_GREP_INDEX].Text) == match.Index) { item.SubItems[Constants.COLUMN_INDEX_COUNT].Text = match.HitCount.ToString(); break; } } }
/// <summary> /// Updates the count column (Thread safe) /// </summary> /// <param name="hit">HitObject that contains updated information</param> /// <history> /// [Curtis_Beard] 11/21/2005 Created /// </history> private void UpdateHitCount(HitObject hit) { // Makes this a thread safe operation if (lstFileNames.InvokeRequired) { UpdateHitCountCallBack _delegate = new UpdateHitCountCallBack(UpdateHitCount); lstFileNames.Invoke(_delegate, new object[1] {hit}); return; } // find correct item to update foreach (ListViewItem _item in lstFileNames.Items) { if (int.Parse(_item.SubItems[Constants.COLUMN_INDEX_GREP_INDEX].Text) == hit.Index) { _item.SubItems[Constants.COLUMN_INDEX_COUNT].Text = hit.HitCount.ToString(); break; } } }