private void tRefresh_Tick(object sender, EventArgs e) { if (dirty) { ts.Enqueue(AsyncStatic.MakeTranslation(txtInput.Text, Translation_callback)); dirty = false; } }
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); } }