mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-04 08:40:49 +08:00
IOC容器添加构造函数注入(DLL类中使用AutoRegisterAttribute特性标注的类,会在流程启动时自动注册),提高可读性。
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Net461DllTest.Device;
|
||||
using Net461DllTest.Signal;
|
||||
using Net461DllTest.ViewModel;
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,11 +17,17 @@ namespace Net461DllTest
|
||||
{
|
||||
public partial class FromWorkBenchView : Form
|
||||
{
|
||||
[AutoInjection]
|
||||
public FromWorkBenchViewModel ViewModel { get; set; }
|
||||
public FromWorkBenchView()
|
||||
private FromWorkBenchViewModel ViewModel;
|
||||
|
||||
public FromWorkBenchView(IFlowEnvironment env)
|
||||
{
|
||||
ViewModel = env.IOC.Instantiate<FromWorkBenchViewModel>();
|
||||
InitializeComponent();
|
||||
Init();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
listBox1.Items.Clear();
|
||||
var enumValues = Enum.GetValues(typeof(OrderSignal)).Cast<OrderSignal>();
|
||||
foreach (var value in enumValues)
|
||||
|
||||
Reference in New Issue
Block a user