Пример #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 GOST_34_2012Subscriber(openedKey, closedKey, name);
                var form          = new SubscriberForm(SubscribersParams, newSub);
                form.FormClosing += SubscriberParams_FormClosing;
                SubscribersParams.Add(new SubscriberParams(form, newSub));
                form.Show();

                BtSetRandomSubscriberParams(this, e);
            });
        }
Пример #2
0
 public SubscriberParams(SubscriberForm subscriberForm, GOST_34_2012Subscriber subscriber)
 {
     this.SubscriberForm = subscriberForm;
     this.Subscriber     = subscriber;
 }