private void button_Add(BoxExchangeEditor bx, List<string> src, bool isInsert = false) { int pos = bx.SourceBox.SelectedIndex - bx.SourceBox.SelectedItems.Count; bx.bxAddItems(bx.SourceBox, bx.TargetBox, isInsert); reLoadButtonItem(bx, src); if (bx.SourceBox.Items.Count != 0) { pos = Math.Max(0, Math.Min(pos, bx.SourceBox.Items.Count - 1)); bx.SourceBox.SelectedIndex = pos;//順序がヘンだが、ENTERの場合はこの後に+1処理が入る模様 } }
private void button_Add(BoxExchangeEditor bx, List <string> src, bool isInsert = false) { int pos = bx.SourceBox.SelectedIndex - bx.SourceBox.SelectedItems.Count; bx.bxAddItems(bx.SourceBox, bx.TargetBox, isInsert); reLoadButtonItem(bx, src); if (bx.SourceBox.Items.Count != 0) { pos = Math.Max(0, Math.Min(pos, bx.SourceBox.Items.Count - 1)); bx.SourceBox.SelectedIndex = pos;//順序がヘンだが、ENTERの場合はこの後に+1処理が入る模様 } }
//特殊アイテムを全追加から外す private void button_AddAll() { bxs.SourceBox.SelectAll(); bxs.bxAddItems(bxs.SourceBox.SelectedItemsList().Where(item => ((ServiceViewItem)item).ServiceInfo.HasSPKey == false), bxs.TargetBox); }