Ejemplo n.º 1
0
        private void TranslateChapterNames()
        {
            WorkingThread thread = new WorkingThread();

            thread.DoWork        += ThreadTranslateName;
            thread.WorkCompleted += Thread_WorkCompleted1;
            workingThreads.Add(thread);
            thread.RunWorkAsync();
        }
Ejemplo n.º 2
0
 public TranslateExecutor(FictionObject fictionObject, int totalCount, int mergeLimit, WorkingThread reportThread)
 {
     this.fictionObject  = fictionObject;
     this.reportThread   = reportThread;
     this.totalCount     = totalCount;
     this.mergeLimit     = mergeLimit;
     processCount        = 0;
     startPoint          = 0;
     originalStrings     = new List <string>();
     translateMap        = new Dictionary <int, string>();
     chapterTranslateMap = new Dictionary <int, string>();
     workingThreads      = new List <WorkingThread>();
 }
Ejemplo n.º 3
0
 private bool StartTranslateThread()
 {
     if (workingThreads.Count < MAX_THREADS)
     {
         WorkingThread thread = new WorkingThread();
         thread.DoWork          += Thread_DoWork;
         thread.WorkCompleted   += Thread_WorkCompleted;
         thread.WorkingProgress += Thread_WorkingProgress;
         workingThreads.Add(thread);
         thread.RunWorkAsync();
         return(true);
     }
     else
     {
         return(false);
     }
 }