private void TranslateChapterNames() { WorkingThread thread = new WorkingThread(); thread.DoWork += ThreadTranslateName; thread.WorkCompleted += Thread_WorkCompleted1; workingThreads.Add(thread); thread.RunWorkAsync(); }
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>(); }
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); } }