mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-26 02:56:35 +08:00
IOC容器添加构造函数注入(DLL类中使用AutoRegisterAttribute特性标注的类,会在流程启动时自动注册),提高可读性。
This commit is contained in:
@@ -11,8 +11,12 @@ namespace Net461DllTest.ViewModel
|
||||
{
|
||||
public class FromWorkBenchViewModel
|
||||
{
|
||||
[AutoInjection]
|
||||
public SiemensPlcDevice Device { get; set; }
|
||||
public FromWorkBenchViewModel(SiemensPlcDevice Device)
|
||||
{
|
||||
this.Device = Device;
|
||||
}
|
||||
private SiemensPlcDevice Device;
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string GetDeviceInfo()
|
||||
@@ -20,7 +24,6 @@ namespace Net461DllTest.ViewModel
|
||||
return Device?.ToString();
|
||||
}
|
||||
|
||||
|
||||
public void Trigger(OrderSignal signal,string spcaeNumber)
|
||||
{
|
||||
_ = Task.Run(() =>
|
||||
|
||||
Reference in New Issue
Block a user