/// <summary> /// ESI key toolbar > Add. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addESIKeyMenu_Click(object sender, EventArgs e) { using (EsiKeyUpdateOrAdditionWindow window = new EsiKeyUpdateOrAdditionWindow()) { window.ShowDialog(this); } }
/// <summary> /// API key toolbar > Edit. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void editAPIKeyMenu_Click(object sender, EventArgs e) { ESIKey esiKey = esiKeysListBox.ESIKeys.ElementAt(esiKeysListBox.SelectedIndex); using (EsiKeyUpdateOrAdditionWindow window = new EsiKeyUpdateOrAdditionWindow(esiKey)) { window.ShowDialog(this); } }
/// <summary> /// On double click, forces the edition. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void apiKeysListBox_MouseDoubleClick(object sender, MouseEventArgs e) { // Search for the double-clicked item int index = 0; foreach (ESIKey esiKey in esiKeysListBox.ESIKeys) { Rectangle rect = esiKeysListBox.GetItemRectangle(index); index++; if (!rect.Contains(e.Location)) { continue; } // Open the edition window using (EsiKeyUpdateOrAdditionWindow window = new EsiKeyUpdateOrAdditionWindow(esiKey)) { window.ShowDialog(this); return; } } }