chr
2026-04-05 fe750b791d5b517cc4e9bc8e99a9a75139a0cfba
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using AddInPlugin.Util;
using OpenTap;
using System;
 
namespace AddInPlugin
{
    public class PostUIMsgHandler
    {
        public static event EventHandler<PostUIMsg> OnPostUIMsg;
 
        public static void OnPostUIMsgGet(PostUIMsg msg)
        {
            OnPostUIMsg?.Invoke(null, msg);
        }
    }
 
    public class PostUIMsg
    {
        public int EventCode;
        public string StringData;
        public bool BoolData;
        public double NumberData;
    }
 
    [Display("PostUIMsgStep", Description: "UIÏûÏ¢")]
    public class PostUIMsgStep : TestStep
    {
        [Display("ʼþ")]
        public int EventCode { get; set; }
        [Display("×Ö·û")]
        public string StringData { get; set; }
        [Display("²¼¶û")]
        public bool BoolData { get; set; }
        [Display("Êý×Ö")]
        public double NumberData { get; set; }
 
 
        public PostUIMsgStep()
        {
            // ToDo: Set default values for properties / settings.
        }
 
        public override void PrePlanRun()
        {
 
        }
 
        public override void Run()
        {
            try
            {
                PostUIMsg msg = new PostUIMsg
                {
                    EventCode = this.EventCode,
                    StringData = string.IsNullOrEmpty(StringData) ? StringData : PlanRun.Resolve(this, StringData, typeof(string)),
                    BoolData = this.BoolData,
                    NumberData = this.NumberData,
                };
                PostUIMsgHandler.OnPostUIMsgGet(msg);
                this.Verdict = Verdict.NotSet;
            }
            catch (Exception ex)
            {
                Log.Error("PostUIMsgStep Run Error. {0}", ex);
                this.Verdict = Verdict.Error;
            }
        }
 
        public override void PostPlanRun()
        {
 
        }
    }
}