alielie
2026-09-10 9ec80cafc23f5ee3278cacce3c9f86f4087b435a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using OpenTap;
using OpenTap.Addin.Listener;
using SeqEditor.Util;
using System.IO;
 
namespace OpenTapEditor
{
    public class UIListener : RootListener
    {
        private LogControl logControl;
        private IStepRunStatus statusHolder;
 
        public UIListener(LogControl logControl, IStepRunStatus statusHolder)
        {
            this.logControl = logControl;
            this.statusHolder = statusHolder;
        }
 
        public override void Close()
        {
            base.Close();
            statusHolder = null;
            logControl = null;
            RootPlanRun = null;
        }
 
        public override void OnResultPublished(Guid stepRunID, ResultTable result)
        {
 
        }
 
        public override void OnTestPlanRunCompleted(TestPlanRun planRun, Stream logStream)
        {
            if (planRun == RootPlanRun)
            {
                logControl.ShowResult(planRun.Verdict);
            }
        }
 
        public override void OnTestStepRunCompleted(TestStepRun stepRun)
        {
            statusHolder.ComplatedStepId(stepRun.TestStepId);
        }
 
        public override void OnTestStepRunStart(TestStepRun stepRun)
        {
            statusHolder.CurrentStepId(stepRun.TestStepId);
        }
 
        public override IResultListener CreateChild()
        {
            var res = new UIListener(logControl, statusHolder)
            {
                RootPlanRun = this.RootPlanRun,
                Root = this.Root == null ? this : this.Root
            };
            return res;
        }
    }
}