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);
        }
        private void renameUnitItem_Click(object sender, EventArgs e)
        {
            TextInputControl inputCtrl = new TextInputControl();
            inputCtrl.Size = inputCtrl.MinimumSize;
            inputCtrl.RegExp = @"[a-zA-Z\d]+";
            inputCtrl.InputText = tabCtrl.SelectedTab.Text;
            inputCtrl.OKPressed += inputCtrl_OKPressed;

            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;
            form.ShowDialog();
            inputCtrl.OKPressed -= inputCtrl_OKPressed;
        }