alielie
2025-08-25 c4a3f8db90530a727ffab77c3bb5bb7d782792bf
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 HMI.Core.Entity;
using System.Collections.Generic;
using System.Reflection;
using System.Xml.Serialization;
 
namespace Plugin.TestBuilder.Model
{
    public class Step : NotifyBase
    {
        //private static readonly Type InterfaceType = typeof(IStepRunner);
        private static readonly Dictionary<string, Assembly> Cache = new Dictionary<string, Assembly>();
        #region 字段
        [XmlIgnore]
        public Program Program { get; set; }
 
        [XmlIgnore]
        public Sequence Sequence { get; set; }
 
        private int _Index;
        public int Index
        {
            get { return _Index; }
            set => Set(ref _Index, value);
        }
 
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set => Set(ref _Name, value);
        }
 
        private string _DllPath = "C:/Users/cheng/source/repos/WPFProject/VisionBuilder.Test/bin/Debug/VisionBuilder.Test.dll";
        public string DllPath
        {
            get { return _DllPath; }
            set => Set(ref _DllPath, value);
        }
 
        private string _ClassName = "VisionBuilder.Test.PluginOne";
        public string ClassName
        {
            get { return _ClassName; }
            set => Set(ref _ClassName, value);
        }
 
        private string _MethodName;
        public string MethodName
        {
            get { return _MethodName; }
            set => Set(ref _MethodName, value);
        }
 
        private string _Description;
        public string Description
        {
            get { return _Description; }
            set => Set(ref _Description, value);
        }
 
        #endregion
 
        public void RunStep()
        {
            //Assembly assembly = Assembly.LoadFrom(DllPath);
            //Type type = assembly.GetType(ClassName);
            //if (type != null && InterfaceType.IsAssignableFrom(type))
            //{
            //    IStepRunner stepRunner = (IStepRunner)assembly.CreateInstance(ClassName);
            //    stepRunner.RunStep(Sequence.Program.TempVars);
            //}
        }
    }
}