Example #1
0
        public void TranslateAsync(GoogleTranslateInfo info)
        {
            btnTranslate.Enabled = false;
            btnTranslateTo.Enabled = false;

            TaskEx.Run(() =>
            {
                info = new GoogleTranslate(Config.APIKey).TranslateText(info);
            },
            () =>
            {
                UpdateGoogleTranslateGUI(info);
            });
        }
 public void BwApp_DoWork(object sender, DoWorkEventArgs e)
 {
     GoogleTranslateInfo gti = e.Argument as GoogleTranslateInfo;
     gti = new GoogleTranslate(Config.APIKey).TranslateText(gti);
     e.Result = gti;
 }