private void uncheckItem(string item) { for (int i = 0; i < listView1.Items.Count; i++) { foreach (string line in FuncParser.parserESPESM(pathDataFolder + listView1.Items[i].Text)) { if (line.ToLower() == item) { listView1.Items[i].Checked = false; uncheckItem(listView1.Items[i].Text.ToLower()); } } } }
private void checkItem(ListViewItem item, bool check) { int lastIndex = -1; bool goodSort = false; bool hasMasters = false; foreach (string line in FuncParser.parserESPESM(pathDataFolder + item.Text)) { hasMasters = true; ListViewItem findItem = listView1.FindItemWithText(line); if (findItem != null && findItem.Index > lastIndex && item.Index > findItem.Index) { if (!findItem.Checked && check) { checkItem(findItem, true); } lastIndex = findItem.Index; goodSort = true; } else { goodSort = false; goodAllMasters = false; break; } } if (!hasMasters) { goodSort = true; } if (!goodSort) { item.ForeColor = System.Drawing.Color.Red; } else if (item.Text.ToLower().Contains(".esm") || FuncParser.checkESM(pathDataFolder + item.Text)) { item.ForeColor = System.Drawing.Color.Blue; } else { item.ForeColor = System.Drawing.Color.Black; } if (check) { item.Checked = goodAllMasters; } }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { listBox1.Items.Clear(); listBox1.Items.AddRange(FuncParser.parserESPESM(pathDataFolder + e.Item.Text).ToArray()); }