优化了示例工程

This commit is contained in:
fengjiayi
2024-09-28 23:55:19 +08:00
parent 51bdbab4d1
commit 10e5d172c6
56 changed files with 9920 additions and 455 deletions

View File

@@ -31,17 +31,21 @@ namespace Net461DllTest
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = ViewModel.GetDeviceInfo();
textBoxPlcInfo.Text = ViewModel.GetDeviceInfo();
}
private void button2_Click(object sender, EventArgs e)
{
if(listBox1.SelectedItem is null)
{
return;
}
string type = listBox1.SelectedItem.ToString();
if (Enum.TryParse(type, out OrderSignal signal) && Enum.IsDefined(typeof(OrderSignal), signal))
if (!string.IsNullOrEmpty(type) && Enum.TryParse(type, out OrderSignal signal) && Enum.IsDefined(typeof(OrderSignal), signal))
{
Console.WriteLine($"Trigger : {type}");
ViewModel.Trigger(signal);
ViewModel.Trigger(signal,textBoxSpaceNum.Text);
}
}