public void UpdateListView(CASCFolder baseEntry, NoFlickerListView fileList, string filter) { Wildcard wildcard = new Wildcard(filter, false, RegexOptions.IgnoreCase); // Sort baseEntry.Entries = baseEntry.EntriesMirror.Where(v => v.Value is CASCFolder || (v.Value is CASCFile && wildcard.IsMatch(v.Value.Name))). OrderBy(v => v.Value, Sorter).ToDictionary(pair => pair.Key, pair => pair.Value); // Update fileList.Tag = baseEntry; fileList.VirtualListSize = 0; fileList.VirtualListSize = baseEntry.Entries.Count; if (fileList.VirtualListSize > 0) { fileList.EnsureVisible(0); fileList.SelectedIndex = 0; fileList.FocusedItem = fileList.Items[0]; } }
public void UpdateListView(CASCFolder baseEntry, NoFlickerListView fileList, string filter) { Wildcard wildcard = new Wildcard(filter, false, RegexOptions.IgnoreCase); // Sort _displayedEntries = baseEntry.Entries.Where(v => v.Value is CASCFolder || (v.Value is CASCFile && wildcard.IsMatch(v.Value.Name))). OrderBy(v => v.Value, Sorter).Select(kv => kv.Value).ToList(); _currentFolder = baseEntry; // Update fileList.VirtualListSize = 0; fileList.VirtualListSize = _displayedEntries.Count; if (fileList.VirtualListSize > 0) { fileList.EnsureVisible(0); fileList.SelectedIndex = 0; fileList.FocusedItem = fileList.Items[0]; } }
private void button1_Click(object sender, EventArgs e) { if (filelist.SelectedIndex < 0) { return; } var item = filelist.FindItemWithText(textBox1.Text, false, filelist.SelectedIndex, true); if (item != null) { filelist.EnsureVisible(item.Index); filelist.SelectedIndex = item.Index; filelist.FocusedItem = item; } else { MessageBox.Show(string.Format("Can't find:'{0}'", textBox1.Text), "CASCExplorer", MessageBoxButtons.OK, MessageBoxIcon.Information); } }