private void removeReceiverBtn_Click(object sender, EventArgs e)
        {
            IReceiver receiver = GetSelectedReceiver();

            if (receiver == null)
            {
                return;
            }

            DialogResult dr = MessageBox.Show(this, "Confirm Delete?", "Confirmation", MessageBoxButtons.YesNo,
                                              MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dr != DialogResult.Yes)
            {
                return;
            }

            receiversListView.Items.Remove(GetSelectedItem());

            if (AddedReceivers.Find(r => r == receiver) != null)
            {
                AddedReceivers.Remove(receiver);
            }
            else
            {
                RemovedReceivers.Add(receiver);
            }
        }
Beispiel #2
0
        private void AddReceiverCombo_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Tag is ReceiverFactory.ReceiverInfo info)
            {
                // Instantiates a new receiver based on the selected type
                var receiver = ReceiverFactory.Instance.Create(info.Type.FullName);

                AddedReceivers.Add(receiver);
                AddReceiver(receiver);
            }
        }