Beispiel #1
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            string str = this.textBox1.Text;
            int    k   = textBox1.SelectionStart;
            bool   flag;

            if (k == 0)
            {
                removeRows(str);
                line.setAlphabet(str);
                return;
            }

            flag = str[k - 1] == '_' || str[k - 1] == ' ';

            if (CountWords(str, str[k - 1]) >= 2 || flag)
            {
                str = str.Remove(k - 1, 1);

                this.textBox1.Text = str;

                this.textBox1.SelectionStart = k - 1;

                if (flag)
                {
                    MessageBox.Show("Использование символа \" \" (пробел) и \"_\" запрещено.", "Информация");
                }
                else
                {
                    MessageBox.Show("Повторение символов запрещено.", "Информация");
                }

                return;
            }

            this.textBox1.Text = str;

            if (controlLen <= str.Length)
            {
                addRows(k - 1, "" + str[k - 1]);
            }
            else
            {
                removeRows(str);
            }

            controlLen = str.Length;

            line.setAlphabet(str);
        }
Beispiel #2
0
        private void восстановитьЛентуToolStripMenuItem_Click(object sender, EventArgs e)
        {
            line.delControl();
            line.Clear();
            InfinityTape newLine = new InfinityTape(JsonConvert.DeserializeObject <SeveLine>(copyLine));

            newLine.Control = splitContainer1.Panel1.Controls;
            this.line       = newLine;
            MoveHead(-dx, -dy);
            line.setControl();
            line.setAlphabet(this.textBox1.Text);
        }