protected virtual void OnSelectedIdChanged(TagId value) { //Check if (!itemIndex.ContainsKey(value)) { return; } //Begin Update TagList.BeginUpdate(); TagList.Items.Clear(); //Load Path TagList_LoadPath(itemIndex[value].Parent); //Sort TagList.Sort(); //Select foreach (ListViewItem item in TagList.Items) { if (item.Tag is FileSystemItem && ((FileSystemItem)item.Tag).ID == value) { item.Selected = true; TagList.EnsureVisible(item.Index); break; } } //End Update TagList.EndUpdate(); }
public TagBrowserDialog(MapFile.IndexEntryList entries, string mapName) { //Init InitializeComponent(); TagList.ListViewItemSorter = new TagSorter(); itemIndex = new Dictionary <TagId, FileSystemItem>(); filesRoot = new FileSystemItem() { Name = mapName }; //Loop foreach (IndexEntry entry in entries) { filesRoot_CreateEntry(entry.Filename, entry.Root, entry.Size == 0 ? entry.PostProcessedSize : entry.Size, entry.Id); } //Begin Update TagList.BeginUpdate(); TagList.Items.Clear(); //Load Path TagList_LoadPath(filesRoot); //Sort TagList.Sort(); //End Update TagList.EndUpdate(); }
private void okButton_Click(object sender, EventArgs e) { //Check if (currentListItem == null) { return; } //Get File System Item FileSystemItem item = (FileSystemItem)currentListItem.Tag; //Check if (item.ID == 0) { //Begin Update TagList.BeginUpdate(); TagList.Items.Clear(); //Load Path TagList_LoadPath(item); //Sort TagList.Sort(); //End Update TagList.EndUpdate(); } else if (item != null) { //Select Tag selectedId = item.ID; DialogResult = DialogResult.OK; } }