Exemple #1
0
        private void Collect(object State)
        {
            while (m_Enable)
            {
                Command command = null;
                while ((command = QueueThreadHelper.SafeDequeue(m_Commands)) != null)
                {
                    if (command.Add)
                    {
                        m_Lines.Add(command.Line);
                    }
                    else
                    {
                        m_Lines.Remove(command.Line);
                    }
                }
                if (Enable)
                {
                    foreach (Line line in m_Lines)
                    {
                        WriteLog(line);
                    }
                }


                System.Threading.Thread.Sleep(m_Sample);
            }
        }
Exemple #2
0
        public void Unregister(Line Line)
        {
            Command command = new Command();

            command.Add  = false;
            command.Line = Line;
            QueueThreadHelper.SafeEnqueue(m_Commands, command);
        }
Exemple #3
0
        public void Register(Line Line)
        {
            var command = new Command();

            command.Add  = true;
            command.Line = Line;
            QueueThreadHelper.SafeEnqueue(m_Commands, command);
        }