This commit is contained in:
2025-03-16 13:28:32 +08:00
parent 01ccf476f1
commit 0ac00af0ad
10 changed files with 71 additions and 82 deletions

View File

@ -9,7 +9,6 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using AntdUI;
using DH.Devices.Devices;
namespace DHSoftware.Views
{
@ -18,14 +17,11 @@ namespace DHSoftware.Views
public AddCameraWindow()
{
InitializeComponent();
btnOK.DialogResult = DialogResult.OK;
btnCancel.DialogResult = DialogResult.Cancel;
this.AcceptButton = btnOK;
this.CancelButton = btnCancel;
stName.Items.Clear();
for(int i = 1; i <= 8; i++)
{

View File

@ -3,6 +3,7 @@
using System.ComponentModel;
using System.Reflection;
using AntdUI;
using DH.Commons.Enums;
using DH.Devices.Vision;
namespace DHSoftware.Views

View File

@ -10,6 +10,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using AntdUI;
using DH.Commons.Enums;
using DH.Devices.Vision;
namespace DHSoftware.Views

View File

@ -3,6 +3,7 @@
using System.ComponentModel;
using System.Reflection;
using AntdUI;
using DH.Commons.Enums;
using DH.Devices.Vision;
using static System.Windows.Forms.AxHost;

View File

@ -1,5 +1,6 @@

using DH.Commons.Enums;
using DH.Devices.Vision;
namespace DHSoftware.Views

View File

@ -136,23 +136,23 @@ namespace DHSoftware.Views
{
if (it.Text == "关联相机")
{
using (var dlg = new AddCameraWindow(cameras))
{
if (dlg.ShowDialog() == DialogResult.OK)
{
var newItem = new MenuItem(dlg.CubicleName);
newItem.IconSvg = "VideoCameraOutlined";
//// 防止重复添加
//if (!menu1.Items.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
//{
clickedItem.Sub.Add(newItem);
//}
//else
//{
// AntdUI.Notification.warn(this, "新增失败", $"{dlg.CubicleName}已存在!", autoClose: 3, align: TAlignFrom.TR);
//}
}
}
//using (var dlg = new AddCameraWindow(cameras))
//{
// if (dlg.ShowDialog() == DialogResult.OK)
// {
// var newItem = new MenuItem(dlg.CubicleName);
// newItem.IconSvg = "VideoCameraOutlined";
// //// 防止重复添加
// //if (!menu1.Items.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
// //{
// clickedItem.Sub.Add(newItem);
// //}
// //else
// //{
// // AntdUI.Notification.warn(this, "新增失败", $"{dlg.CubicleName}已存在!", autoClose: 3, align: TAlignFrom.TR);
// //}
// }
//}
}
}, menulist);
}