Esempio n. 1
0
        private void BtAddSubscriber_Click(object sender, EventArgs e)
        {
            CatchException(() =>
            {
                var name = string.IsNullOrWhiteSpace(tbSubscriberName.Text)
                    ? throw new ArgumentException("Имя подписчика не должно быть пустым")
                    : tbSubscriberName.Text;
                var openedKey = BigInteger.Parse(tbOpenedKey.Text);
                var closedKey = BigInteger.Parse(tbClosedKey.Text);
                var g         = int.Parse(tbParamG.Text);
                var p         = int.Parse(tbParamP.Text);

                var newSub        = new ElgamalSubscriber(openedKey, closedKey, name, p, g);
                var form          = new SubscriberForm(SubscribersParams, newSub);
                form.FormClosing += SubscriberParams_FormClosing;
                SubscribersParams.Add(new SubscriberParams(form, newSub));
                form.Show();

                BtSetRandomSubscriberParams(this, e);
            });
        }
Esempio n. 2
0
 public SubscriberParams(SubscriberForm subscriberForm, ElgamalSubscriber elgamalSubscriber)
 {
     this.SubscriberForm    = subscriberForm;
     this.ElgamalSubscriber = elgamalSubscriber;
 }