示例#1
0
 public void ReportProgress(int percentage, object state = null)
 {
     if (WorkingProgress != null)
     {
         WorkingEventArg eventArg = new WorkingEventArg();
         eventArg.ProgressPercentage = percentage;
         eventArg.UserState          = state;
         ProcessDelegate(WorkingProgress, this, eventArg);
     }
 }
 private void Thread_WorkCompleted(object sender, WorkingEventArg e)
 {
     workingThreads.Remove((WorkingThread)sender);
     if (workingThreads.Count == 0 && translateMap.Keys.Count == totalCount && start)
     {
         //lock(lockObject)
         //{
         // SaveTranslateFiles();
         ConvertToEpubs(false);
         //}
     }
 }
        private void Thread_DoWork(object sender, WorkingEventArg e)
        {
            while (processCount < originalStrings.Count && processCount < totalCount)
            {
                int    count    = GetNextCount();
                string original = originalStrings[count];

                string result = original;

                if (!original.StartsWith("VPBOBBIE"))
                {
                    original = Utility.CleanContent(original, fictionObject);
                    result   = Translate(original, reportThread);
                }
                else
                {
                    result = original.Substring(8);
                }

                translateMap[count] = result;
                reportThread.ReportProgress(count);
            }
        }
 private void ThreadTranslateName(object sender, WorkingEventArg e)
 {
     TranslateChaptersTitle();
 }
 private void Thread_WorkCompleted1(object sender, WorkingEventArg e)
 {
     workingThreads.Remove((WorkingThread)sender);
 }
 private void Thread_WorkingProgress(object sender, WorkingEventArg e)
 {
 }