public IAsyncResult BeginTranslate(IEnumerable<AutoTranslationItem> translationItems, string from, string to, AsyncCallback callback, object state)
 {
     if (asyncWorkerInstance != null) throw new InvalidOperationException("Another asynchronous process is in progress");     // do not translate
     this.stopRequested = false;
     asyncWorkerInstance = new TranslateInvoker(Translate);
     return asyncWorkerInstance.BeginInvoke(translationItems, from, to, callback, state);
 }
Beispiel #2
0
 public IAsyncResult BeginTranslate(IEnumerable <AutoTranslationItem> translationItems, string from, string to, AsyncCallback callback, object state)
 {
     if (asyncWorkerInstance != null)
     {
         throw new InvalidOperationException("Another asynchronous process is in progress");                                  // do not translate
     }
     this.stopRequested  = false;
     asyncWorkerInstance = new TranslateInvoker(Translate);
     return(asyncWorkerInstance.BeginInvoke(translationItems, from, to, callback, state));
 }
 public void EndTranslate(IAsyncResult result)
 {
     this.asyncWorkerInstance.EndInvoke(result);
     this.asyncWorkerInstance = null;
 }
Beispiel #4
0
 public void EndTranslate(IAsyncResult result)
 {
     this.asyncWorkerInstance.EndInvoke(result);
     this.asyncWorkerInstance = null;
 }