예제 #1
0
파일: MainWindow.cs 프로젝트: gentcp/YAT
        private async void M_TButton_Click(object sender, EventArgs e)
        {
            this.m_ATimer.Stop();
            string text = this.m_FRichTextBox.Text;

            if (text.Length <= 0)
            {
                return;
            }
            string from = ((ToolStripLabel)this.m_FComboBox.SelectedItem).Name;
            string to   = ((ToolStripLabel)this.m_TComboBox.SelectedItem).Name;

            this.SetStatusText(this.m_CRManager.GetString("Translation"));
            string r = "";

            try
            {
                r = await this.m_APIManager.TranslationText(from, to, text);
            }
            catch (Exception)
            {
            }
            XMLTTData data = new XMLTTData(r);

            this.SetTranslatedText(data);
        }
예제 #2
0
 public void SetTranslatedText(XMLTTData data)
 {
     if (data.IsEmpty())
     {
         this.p_ErrorReason(data.GetCode(), true);
         return;
     }
     this.m_TRichTextBox.Text = data.GetText();
 }