private void _manager_ValueIn(object sender, EventArgs e)
 {
     if (ValueIn != null)
     {
         RegisterMachineValueInEventArgs args = new RegisterMachineValueInEventArgs();
         ValueIn(this, args);
         _manager.WriteValue(args.Value);
     }
 }
        private void _machine_ValueIn(object sender, RegisterMachineValueInEventArgs e)
        {
            bool dialogOk = false;

            TextInputControl inputCtrl = new TextInputControl();
            inputCtrl.Size = inputCtrl.MinimumSize;
            inputCtrl.RegExp = @"\d+";
            inputCtrl.InputText = "0";
            inputCtrl.OKPressed += (x, a) => {
                        (x as TextInputControl).ParentForm.Close();
                        dialogOk = true;
               };

            Form form = new Form();
            form.Text = "Запрос ввода значения от ПМБР";
            form.Controls.Add(inputCtrl);
            inputCtrl.Dock = DockStyle.Fill;
            form.ClientSize = inputCtrl.MinimumSize;
            form.MinimumSize = new Size(form.Width, form.Height);
            form.MaximumSize = new Size(inputCtrl.MaximumSize.Width, form.Height);
            form.FormBorderStyle = FormBorderStyle.SizableToolWindow;
            DialogResult res = form.ShowDialog();

            if(dialogOk)
                e.Value = BigInteger.Parse(inputCtrl.InputText);
        }