| | |
| | | using System.Collections.Generic; |
| | | using System.Reflection; |
| | | using System.Xml.Serialization; |
| | | using VisionBuilder.Core.Api; |
| | | using HMI.Core.Api; |
| | | |
| | | namespace WPFProject.Models |
| | | { |
| | | public class Step : NotifyBase |
| | | { |
| | | private static readonly Type InterfaceType = typeof(IStepRunner); |
| | | //private static readonly Type InterfaceType = typeof(IStepRunner); |
| | | private static readonly Dictionary<string, Assembly> Cache = new Dictionary<string, Assembly>(); |
| | | #region 字段 |
| | | [XmlIgnore] |
| | |
| | | |
| | | 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); |
| | | } |
| | | //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); |
| | | //} |
| | | } |
| | | } |
| | | } |