private void OnItemSelectTask(object sender, EventArgs e) { item_select_step_timer_.Restart(); while (item_select_step_timer_.ElapsedMilliseconds < ITEM_SELECT_STEP) { if (item_select_index_ >= VirtualListSize) { break; } SelectedIndices.Add(item_select_index_++); } ItemSelectBusyStatusChanging?.Invoke(this, EventArgs.Empty); if (item_select_index_ >= VirtualListSize) { item_select_task_.Stop(); ItemSelectBusy = false; ItemSelectBusyStatusChanged?.Invoke(this, EventArgs.Empty); OnSelectedIndexChanged(EventArgs.Empty); } }
public void SelectAllItems() { if (ItemSelectBusy) { return; } item_select_index_ = 0; ItemSelectBusy = true; ItemSelectBusyStatusChanged?.Invoke(this, EventArgs.Empty); item_select_task_.Stop(); item_select_task_.Start(); }