protected override void DoWork(TranslateContext context)
            {
                var service          = context.Service;
                int batchWait        = 0;
                var batchWorkingList = new List <ChattingLine>();

                while (!WorkingThreadStopping)
                {
                    if (batchWorkingList.Count > BatchThreshold || (batchWait > 1 && batchWorkingList.Count > 0))
                    {
                        batchWait = 0;
                        // Invoke translate service

                        try
                        {
                            context.Provider.Translate(batchWorkingList);

                            // TODO: Set color and label
                            var finalResultBuilder = new RTFBuilder();
                            foreach (var line in batchWorkingList)
                            {
                                var settings = service._plugin.GetChannelSettings(line.EventCode);
                                finalResultBuilder.ForeColor(settings.DisplayColor).AppendLine(
                                    $"{TextProcessor.BuildQuote(line, settings.ShowLabel)}{line.TranslatedContent}");
                            }

                            service._controller.NotifyOverlayContentUpdated(false, finalResultBuilder.ToString());
                        }
                        catch (Exception ex)
                        {
                            service._controller.NotifyLogMessageAppend(false, ex + "\n");
                        }
                        finally
                        {
                            batchWorkingList.Clear();
                        }
                    }
                    else
                    {
                        lock (service._mainLock)
                        {
                            if (service._pendingLines.Count > 0)
                            {
                                batchWait = 0;
                                batchWorkingList.AddRange(service._pendingLines);
                                service._pendingLines.Clear();
                            }
                            else
                            {
                                if (batchWorkingList.Count > 0)
                                {
                                    batchWait++;
                                }
                                Monitor.Wait(service._mainLock, 500);
                            }
                        }
                    }
                }
            }
            protected override void DoWork(TranslateContext context)
            {
                var service          = context.Service;
                var provider         = context.Provider;
                int batchWait        = 0;
                var batchWorkingList = new List <ChattingLine>();
                var availableLines   = new List <ChattingLine>();

                while (!WorkingThreadStopping)
                {
                    if (batchWorkingList.Count > BatchThreshold || (batchWait > 1 && batchWorkingList.Count > 0))
                    {
                        batchWait = 0;
                        // Invoke translate service

                        try
                        {
                            // Make sure we do have something to translate
                            batchWorkingList.ForEach(it =>
                            {
                                if (provider.PreprocessLine(it))
                                {
                                    availableLines.Add(it);
                                }
                                else
                                {
                                    it.TranslatedContent = string.Empty;
                                }
                            });
                            if (availableLines.Count != 0)
                            {
                                provider.Translate(availableLines);
                                availableLines.Clear();
                            }

                            var finalResultBuilder = new RTFBuilder();
                            foreach (var line in batchWorkingList)
                            {
                                if (service.AddTimestamp)
                                {
                                    finalResultBuilder.ForeColor(Color.White);
                                    string formattedTime;
                                    if (service.Timestamp24Hour)
                                    {
                                        formattedTime = $"[{line.Timestamp:HH:mm}]";
                                    }
                                    else
                                    {
                                        formattedTime =
                                            string.Format("[{0}]",
                                                          line.Timestamp.ToString(
                                                              line.Timestamp.Hour > 11
                                                        ? strings.timeFormat12HourPM
                                                        : strings.timeFormat12HourAM,
                                                              strings.Culture));
                                    }
                                    finalResultBuilder.Append(formattedTime);
                                }
                                var settings = service._plugin.GetChannelSettings(line.EventCode);
                                finalResultBuilder.ForeColor(settings.DisplayColor);
                                finalResultBuilder.AppendLine(
                                    $"{TextProcessor.BuildQuote(line, settings.ShowLabel)}{line.TranslatedContent}");
                            }

                            service._controller.NotifyOverlayContentUpdated(false, finalResultBuilder.ToString());
                        }
                        catch (Exception ex)
                        {
                            service._controller.NotifyLogMessageAppend(false, ex + "\n");
                        }
                        finally
                        {
                            batchWorkingList.Clear();
                        }
                    }
                    else
                    {
                        lock (service._mainLock)
                        {
                            if (service._pendingLines.Count > 0)
                            {
                                batchWait = 0;
                                batchWorkingList.AddRange(service._pendingLines);
                                service._pendingLines.Clear();
                            }
                            else
                            {
                                if (batchWorkingList.Count > 0)
                                {
                                    batchWait++;
                                }
                                Monitor.Wait(service._mainLock, 500);
                            }
                        }
                    }
                }
            }