Beispiel #1
0
        private void Initialize()
        {
            var lite = new Button();
            var pro  = new Button();

            ConstructorControls.WorkWithButton(lite, new Rectangle(361, 485, 241, 49), "lite", this, new LiteTranslate());
            ConstructorControls.WorkWithButton(pro, new Rectangle(676, 485, 241, 49), "pro", this, new ProMenu());
            Controls.Add(lite);
            Controls.Add(pro);
        }
Beispiel #2
0
        private void Initialization()
        {
            var checkYourself = new Button();
            var dictionary    = new Button();
            var addNewWord    = new Button();
            var back          = new Button();

            ConstructorControls.CreateButton(back, new Rectangle(10, 50, 41, 36), "", this);
            ConstructorControls.WorkWithButton(checkYourself, new Rectangle(467, 266, 344, 49), "check yourself", this, new ProTarnslate());
            ConstructorControls.WorkWithButton(dictionary, new Rectangle(519, 359, 240, 49), "dictionary", this, new MyDictionary());
            ConstructorControls.WorkWithButton(addNewWord, new Rectangle(467, 451, 344, 49), "add a word", this, new AddNewWord());
            AddClicl(back);
        }
Beispiel #3
0
        private void Initialize()
        {
            var buttonTranslate = new Button();
            var back            = new Button();

            ConstructorControls.CreateButton(back, new Rectangle(10, 50, 43, 36), "", this);
            AddClick(back);
            ConstructorControls.WorkWithButton(buttonTranslate, new Rectangle(500, 132, 300, 49), "Translate", this);
            buttonTranslate.Click += (e, a) =>
            {
                outputTextBox.Text = TranslateText.GetTextTranslation(inputTextBox.Text);
            };
            Controls.Add(buttonTranslate);

            inputTextBox  = new TextBox();
            outputTextBox = new TextBox();
            ConstructorControls.CreateTextBox(inputTextBox, 107, 204, this, 500, 411);
            ConstructorControls.CreateTextBox(outputTextBox, 691, 204, this, 500, 411);
        }
Beispiel #4
0
        private void InitializeComponent()
        {
            var addWord = new Button();
            var rec     = new Rectangle(560, 138, 64, 54);

            addWord.BackColor = Color.FromArgb(199, 214, 219);
            var wordTextBox      = new TextBox();
            var translateTextBox = new TextBox();
            var backButton       = new Button();

            ConstructorControls.WorkWithButton(addWord, rec, "добавить", this);
            addWord.Click += (e, a) =>
            {
                Translator.KnownWords.Add(wordTextBox.Text, translateTextBox.Text);
            };
            ConstructorControls.CreateButton(backButton, new Rectangle(15, 50, 41, 36), "", this);
            AddClick(backButton);
            ConstructorControls.CreateTextBox(translateTextBox, 135, 285, this, 475, 224);
            ConstructorControls.CreateTextBox(wordTextBox, 136, 138, this, 402, 54);
        }
Beispiel #5
0
        private void Initialize()
        {
            var checkWord = new Button();
            var rec       = new Rectangle(560, 138, 64, 54);
            var back      = new Button();
            var textBox1  = new TextBox();
            var textBox2  = new TextBox();
            var textBox3  = new TextBox();
            var enterWord = new TextBox();

            ConstructorControls.CreateTextBox(enterWord, 130, 140, this, 410, 50);
            ConstructorControls.CreateTextBox(textBox1, 740, 145, this, 427, 107);
            ConstructorControls.CreateTextBox(textBox2, 740, 318, this, 427, 107);
            ConstructorControls.CreateTextBox(textBox3, 740, 490, this, 427, 107);
            ConstructorControls.CreateButton(back, new Rectangle(10, 50, 41, 36), "", this);
            ConstructorControls.WorkWithButton(checkWord, rec, "перевести", this);
            checkWord.Click += (e, a) =>
            {
                textBox1.Text = Translator.TranslateWord(enterWord.Text);
            };
            checkWord.BackColor = Color.FromArgb(199, 214, 219);
            AddClick(back);
        }
Beispiel #6
0
        private void Initialize()
        {
            var inputTextBox  = new TextBox();
            var outputTextBox = new TextBox();
            var back          = new Button();

            ConstructorControls.CreateButton(back, new Rectangle(10, 45, 41, 36), "", this);
            AddClick(back);
            ConstructorControls.CreateTextBox(inputTextBox, 99, 148, this, 449, 480);
            ConstructorControls.CreateTextBox(outputTextBox, 559, 148, this, 449, 480);
            var btn = new Button();

            ConstructorControls.WorkWithButton(btn, new Rectangle(0, 0, 200, 50), "сравнить", this);
            btn.Click += (e, a) =>
            {
                var text1 = TranslateText.GetTextTranslation(inputTextBox.Text);
                var text2 = outputTextBox.Text;
                btn.Text = LevenshteinCalculator.GetCompare(text1.Split(' ')
                                                            .Select(x =>
                {
                    if (!Char.IsLetter(x, x.Length - 1))
                    {
                        return(x.Remove(x.Length - 1));
                    }
                    return(x);
                }).ToList(), text2.Split(' ')
                                                            .Select(x =>
                {
                    if (!Char.IsLetter(x, x.Length - 1))
                    {
                        return(x.Remove(x.Length - 1));
                    }
                    return(x);
                }).ToList()
                                                            ).ToString();
            };
        }