private void uxListBox_KeyUp(object sender, KeyEventArgs e) { if (Mode == DisplayData.Question) { if (e.KeyCode == Keys.Enter) { var selectedText = uxListBox.GetItemText(uxListBox.SelectedItem); ClearList(); Mode = DisplayData.Default; uxInputText.Text = ""; HideForm(); uxInputText.Enabled = true; //PluginCallback?.Invoke(selectedText); if (PluginCallback != null) { PluginCallback.Invoke(selectedText); } else { ClearList(); } } else if (e.KeyCode == Keys.Escape) { uxInputText.Text = ""; ClearList(); Mode = DisplayData.Default; } } }
private async Task OnPluginCallback(object source, ActionEventArgs e) { if (PluginCallback == null) { return; } await PluginCallback.Invoke(source, e); }