Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            YandexTranslate vm = new YandexTranslate();

            UpdateStatusBar("InProcess...");
            if (this.checkBox1.CheckState == CheckState.Unchecked)
            {
                if (this.maskedTextBox1.Text.Contains("StringResource"))
                {
                    XMLParse.GetStringValueFromResource(this.maskedTextBox1.Text, ((KeyValuePair <string, string>)comboBox1.SelectedItem).Key, this.textBox1.Text);
                }
                else
                {
                    Internalization.FormResourceConverter.ConvertFormResx(this.maskedTextBox1.Text, ((KeyValuePair <string, string>)comboBox1.SelectedItem).Key, this.textBox1.Text);
                }
            }
            else
            {
                if ((this.textBox2.Text != string.Empty) && (this.textBox3.Text != String.Empty))
                {
                    if (this.maskedTextBox1.Text.Contains("StringResource"))
                    {
                        XMLParse.GetStringValueFromResource(this.maskedTextBox1.Text, (this.textBox2.Text + "-" + this.textBox3.Text), this.textBox1.Text);
                    }
                    else
                    {
                        Internalization.FormResourceConverter.ConvertFormResx(this.maskedTextBox1.Text, (this.textBox2.Text + "-" + this.textBox3.Text), this.textBox1.Text);
                    }
                }
            }

            UpdateStatusBar("Done");
        }
Beispiel #2
0
 public Translator()
 {
     InitializeComponent();
     YandexTranslate.PopulateLanguageCbo(comboBox1);
     UpdateStatusBar("Ready...");
 }