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

@ -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);
}