void contractsGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { Cursor = Cursors.WaitCursor; try { CourierCalc calc = new CourierCalc((Contract)contractsGrid.Rows[e.RowIndex].DataBoundItem, _mode != ContractViewMode.AutoContractor); calc.ShowDialog(); } finally { Cursor = Cursors.Default; } } }
private void btnNewContract_Click(object sender, EventArgs e) { ContractType type = ContractType.Any; if(cmbType.SelectedValue != null) { type = (ContractType)cmbType.SelectedValue; } SortedList<object, string> options = new SortedList<object, string>(); List<CharCorpOption> charcorps = UserAccount.CurrentGroup.GetCharCorpOptions(APIDataType.Assets); charcorps.Sort(); foreach (CharCorpOption opt in charcorps) { options.Add(opt.Corp ? opt.CharacterObj.CorpID : opt.CharacterObj.CharID, opt.Name); } OptionPicker picker = new OptionPicker("Select Owner", "Select a character or corporation to create" + " a contract for.", options); if (picker.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; try { CourierCalc courierCalc = new CourierCalc((long)picker.SelectedItem, type); courierCalc.ShowDialog(); RefreshList(); } finally { Cursor = Cursors.Default; } } }