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
using OpenTap.Addin.Util;
using OpenTap;
using System;
using OpenTap.Addin.Entity;
using OpenTap.Addin.Listener;
 
namespace AddInPlugin
{
    [Display("PostUIMsgStep", Description: "UIÏûÏ¢")]
    public class PostUIMsgStep : TestStep
    {
        [Display("ʼþ")]
        public int EventCode { get; set; }
        [Display("×Ö·û´®")]
        public string StringData { get; set; }
        [Display("²¼¶û")]
        public string BoolData { get; set; }
        [Display("Êý×Ö")]
        public string NumberData { get; set; }
 
 
        public PostUIMsgStep()
        {
            // ToDo: Set default values for properties / settings.
        }
 
        public override void PrePlanRun()
        {
 
        }
 
        protected override void RunDetail()
        {
            try
            {
                PostUIMsg msg = new PostUIMsg
                {
                    EventCode = this.EventCode,
                    StringData = string.IsNullOrEmpty(StringData) ? StringData : PlanRun.Resolve(this, StringData, typeof(string)),
                    BoolData = string.IsNullOrEmpty(BoolData) ? false : PlanRun.Resolve(this, BoolData, typeof(bool)),
                    NumberData = string.IsNullOrEmpty(NumberData) ?new NumberData(0) : PlanRun.Resolve(this, NumberData, typeof(NumberData)),
                };
                PlanRun.uIMessageHandler.OnPostUIMsgGet(msg);
                this.Verdict = Verdict.NotSet;
            }
            catch (Exception ex)
            {
                Log.Error("PostUIMsgStep Run Error. {0}", ex);
                this.Verdict = Verdict.Error;
            }
        }
 
        public override void PostPlanRun()
        {
 
        }
    }
}