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 Cache = new Dictionary(); #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); //} } } }