/// <summary> /// Opens the dialog for creating a new message queue. /// </summary> void addQueueButton_Click(object sender, EventArgs e) { using (var dialog = new FormMessageQueue()) { if (dialog.ShowDialog(this) == DialogResult.OK) { var queue = new MessageQueue(dialog.ID); queuesListBox.Items.Add(queue); Program.MessageQueues.Add(queue); } } }
/// <summary> /// Opens the dialog to edit the selected queue. /// </summary> void editQueueButton_Click(object sender, EventArgs e) { if (queuesListBox.SelectedItem is MessageQueue queue) { using (var form = new FormMessageQueue(queue.Guid.ToString())) { if (form.ShowDialog(this) == DialogResult.OK) { queuesListBox.Invalidate(); queue.Load(); } } } }