// For now this is only used to determine what language to translate to, so it // follows the datasource used by translation. // If we need to support scan-for languages under OCR, that should be parallel. public static IAsyncGSL MakeGSL(GSLCallback callback) { switch (Properties.Settings.Default.TranslationDataSource) { case DataSource.Google: return(new GoogleImpl.AsyncGSL(callback)); case DataSource.Microsoft: return(new MicrosoftImpl.AsyncGSL(callback)); // TODO: Replace this with working code case DataSource.DeepL: return(new GoogleImpl.AsyncGSL(callback)); default: return(new DummyImpl.AsyncGSL(callback)); } }
public AsyncGSL(GSLCallback callback) { this.callback = callback; task = Task.Run(DoGSL); }
public AsyncGSL(GSLCallback callback) { callback?.Invoke(this); }