public async Task <Item> GetItemAsync(int itemId) { if (ItemsMap == null || ItemsMap.Count == 0) { await SetUpItemsMapAsync(); } ItemsMap.TryGetValue(itemId, out var item); return(item); }
public override void Insert(Int32 index, Object item) { if (!(item is ListViewItem lvitem)) { lvitem = ItemsMap.TryGetValue(item, new ListViewItem(item.ToString())); if (item is FSWatcher watcher) { lvitem.Tag = watcher; } } if (!(lvitem.Tag is FSWatcher)) { lvitem.Tag = new FSWatcher(lvitem.Text); } base.Insert(index, lvitem); }