Esempio n. 1
0
 private void tRefresh_Tick(object sender, EventArgs e)
 {
     if (dirty)
     {
         ts.Enqueue(AsyncStatic.MakeTranslation(txtInput.Text, Translation_callback));
         dirty = false;
     }
 }
Esempio n. 2
0
 public void UpdateText(IAsyncOCR OCRResult, TranslationCallback callback = null)
 {
     // Only reevaluate if the underlying text actually changed
     if (atrans == null || this.GetText(OCRResult) != this.atrans.rawText)
     {
         string NewText = GetText(OCRResult);
         BabelForm.Invoke(BabelForm.SafeIncrementOdometer, new object[] { 0, NewText.Length }); // Update odometer
         atrans = AsyncStatic.MakeTranslation(NewText, callback);
     }
 }