Refreshes the item's listbox, updating all items whose names have changed.
()
| 56 | /// Refreshes the item's listbox, updating all items whose names have changed. |
| 57 | /// </summary> |
| 58 | public void refresh() |
| 59 | { |
| 60 | for (int i = 0; i < listBox.Items.Count; ++i) |
| 61 | { |
| 62 | object item = listBox.Items[i]; |
| 63 | String newStr = item.ToString(); |
| 64 | |
| 65 | if (!itemCache.ContainsKey(item)) itemCache.Add(item, newStr); |
| 66 | if (itemCache[item].CompareTo(newStr) != 0) |
| 67 | { |
| 68 | listBox.Items[i] = item; |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | } |
no test coverage detected