private void SelectIndexAsSoonAsAvailable(int idx) { Action selectItem = () => { int currentRun = m_addItemsRun; while (true) { System.Threading.Thread.Sleep(50); lock (asyncItemAddLockObject) { if (currentRun != m_addItemsRun) { break; } if (idx < CurrentItemListControl.Items.Count - 1) { Action selectAndEnsureVisible = () => { CurrentItemListControl.Items[idx].Selected = true; CurrentItemListControl.Items[idx].EnsureVisible(); }; CurrentItemListControl.Invoke(selectAndEnsureVisible); break; } } } }; selectItem.BeginInvoke(null, null); }
public void ShowAtPosition(Point point) { if (!Visible) { Opacity = 0f; Show(); DesktopLocation = point; Opacity = .9f; Visible = true; MakeCurrentItemListVisible(); } else { DesktopLocation = point; Opacity = .9f; } if (CurrentItemListControl != null) { CurrentItemListControl.UpdateToolTip(); } }