private void ViewMenu_Execute_Click(object sender, EventArgs e) { /*/ * var rows = APIView.SelectedRows.Cast<DataGridViewRow>().OrderBy( r => r.Cells[APIView_FileName.Index].Value ); * * foreach ( DataGridViewRow row in rows ) { * ExecuteAPI( (string)row.Cells[APIView_FileName.Index].Value ); * } * /*/ if (!APICaller.IsBusy) { APICaller.RunWorkerAsync(APIView.SelectedRows.Cast <DataGridViewRow>().Select(row => row.Cells[APIView_FileName.Index].Value as string).OrderBy(s => s)); } else if (MessageBox.Show("既に実行中です。\n中断しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.Yes) { APICaller.CancelAsync(); } //*/ }