public void AsyncTranslation_callback(IAsyncTranslation result) { if (PhraseRects.All(x => x.atrans.isDone == true)) { SaveForStreaming(); } pbxDisplay.Invalidate(); }
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); } }
private void Translation_callback(IAsyncTranslation tr) { Invalidate(); }