diff Implab.Diagnostics.Interactive/InteractiveListener.cs @ 192:f1da3afc3521 release v2.1

Слияние с v2
author cin
date Fri, 22 Apr 2016 13:10:34 +0300
parents 04d4c92d0f28
children cbb0bd8fc0d1
line wrap: on
line diff
--- a/Implab.Diagnostics.Interactive/InteractiveListener.cs	Wed Sep 03 18:34:02 2014 +0400
+++ b/Implab.Diagnostics.Interactive/InteractiveListener.cs	Fri Apr 22 13:10:34 2016 +0300
@@ -9,15 +9,15 @@
 
 namespace Implab.Diagnostics.Interactive
 {
-    public class InteractiveListener: TextListenerBase
+    public class InteractiveListener: ListenerBase
     {
         TraceForm m_form;
         
         SynchronizationContext m_syncGuiThread;
-        readonly Promise<object> m_guiStarted = new Promise<object>();
+        readonly Promise m_guiStarted = new Promise();
         
         readonly IPromise m_guiFinished;
-        readonly IPromise m_workerFinished = new Promise<object>();
+        //        readonly IPromise m_workerFinished = new Promise<object>();
         
         readonly MTQueue<TraceViewItem> m_queue = new MTQueue<TraceViewItem>();
         readonly AutoResetEvent m_queueEvent = new AutoResetEvent(false);
@@ -29,9 +29,9 @@
         bool m_paused;
         readonly ManualResetEvent m_pauseEvent = new ManualResetEvent(true);
 
-        public InteractiveListener(bool global) : base(global) {
-            m_guiFinished = AsyncPool.InvokeNewThread(GuiThread);
-            m_workerFinished = AsyncPool.InvokeNewThread(QueueThread);
+        public InteractiveListener() {
+            m_guiFinished = AsyncPool.RunThread(GuiThread);
+            /*m_workerFinished = */AsyncPool.RunThread(QueueThread);
 
             m_guiStarted.Join();
         }
@@ -107,12 +107,12 @@
             base.Dispose(disposing);
         }
 
-        protected override void WriteEntry(TraceContext context, EventText text, string channel) {
+        public override void Write(LogEventArgs args, object entry) {
             var item = new TraceViewItem {
-                Indent = text.indent,
-                Message = text.content,
-                Thread = context.ThreadId,
-                Channel = channel,
+                Indent = args.Operation.Level,
+                Message = entry.ToString(),
+                Thread = args.ThreadId,
+                Channel = args.ChannelName,
                 Timestamp = Environment.TickCount
             };