public void fillNumbers(c_DataUpdateObject obj) { int i = 0; foreach (DictionaryEntry v in obj.Get()) { ListViewItem lvi = new ListViewItem(); lvi.Text = $"{i++}".PadLeft(2, '0'); lvi.SubItems.Add(v.Key.ToString().Substring(v.Key.ToString().IndexOf("_") + 1)); lvi.SubItems.Add(v.Value.ToString()); lvi.BackColor = i % 2 == 0 ? Color.WhiteSmoke : Color.LightYellow; lv_UpdateNumbers.Items.Add(lvi); } foreach (ListViewItem lvi in lv_UpdateNumbers.Items) { if (lvi.SubItems[1].Text.ToLower().Contains("image") && _l is null) { _l = lvi; continue; } if (lvi.SubItems[1].Text.ToLower().Contains("files") && _l2 is null) { _l2 = lvi; continue; } } }
private void btn_Menu_Data_CheckUpdates_Click(object sender, EventArgs e) { c_DataUpdateObject v = uh.checkUpdate(); Hashtable vv = v.Get(); int i = 0; foreach (DictionaryEntry vvv in vv) { if (int.TryParse(vvv.Value.ToString(), out int ii)) { i += ii; } } if (i > 0) { openUpdateScreen(v); } }