示例#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 q         = int.Parse(tbParamQ.Text);
                var p         = int.Parse(tbParamP.Text);

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

                BtSetRandomSubscriberParams(this, e);
            });
        }
示例#2
0
 public SubscriberParams(SubscriberForm subscriberForm, DSASubscriber subscriber)
 {
     this.SubscriberForm = subscriberForm;
     this.Subscriber     = subscriber;
 }