FrmSet.cs
3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using Asa.FaceControl;
using System.Windows.Forms;
using BLL;
using DocumentFormat.OpenXml.Drawing;
using DocumentFormat.OpenXml.Office.CustomUI;
using System.Windows.Forms.Integration;
using SmartScan.SetControl.WPF;
using SmartScan.SetControl.WPF.Model;
using static SmartScan.SetControl.WPF.Model.NeoAlertBox;
namespace SmartScan
{
public partial class FrmSet : FaceFormNormal
{
private readonly Dictionary<FaceButton, Model.ISetMenu> menu = new();
public FrmSet()
{
InitializeComponent();
//WebService.Open();//启动条码匹配服务
}
private void FrmSet_Load(object sender, EventArgs e)
{
//menu.Add(BtnKeyword, new UsrMacro());
menu.Add(BtnKeyword, new UsrWpfPanel(new NS_Keyword()));
menu.Add(BtnMaterial, new UsrWpfPanel(new WPF_MaterialTemplate()));
menu.Add(BtnLabel, new UsrPrintTemplate());
menu.Add(BtnDataSource, new UsrDataSource());
//menu.Add(BtnGenneralSetting, new UsrWorkMode());
menu.Add(BtnGenneralSetting, new UsrWpfPanel(new WPFWorkMode()));
// menu.Add(aaa, new UsrWpfPanel(new WPF_MaterialTemplate()));
Language.LoadLanguage(BLLCommon.config.Language);
Language.SetLanguage(this);
foreach (FaceButton button in menu.Keys)
{
FacePanel pnl = menu[button].GetPanel();
pnl.Left = PnlTemp.Left;
pnl.Top = PnlTemp.Top;
pnl.Width = PnlTemp.Width;
pnl.Height = PnlTemp.Height;
pnl.Anchor = PnlTemp.Anchor;
pnl.Visible = false;
Controls.Add(pnl);
}
BtnKeyword.HoldPress = true;
menu[BtnKeyword].GetPanel().Visible = true;
Maximize();
}
private void BtnMenu_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
{
bool rtn = button == sender;
button.HoldPress = rtn;
menu[button].GetPanel().Visible = rtn;
}
}
private void BtnOK_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
menu[button].Save();
string text = Language.Dialog(Model.LanguageDialogKey.SAVE_SUCCEED);
bool result = NeoAlertBox.Show("", text, AlertType.Success, "NEO SCAN", true);
// new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
BLLCommon.extension.Update();
DialogResult = DialogResult.OK;
//点击后,刷新主界面参数控件
//kmon
//2025-6-24
FrmMain.mon_frmMain.InitializeWpfControl();
}
private void BtnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void BtnApply_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
menu[button].Save();
string text = Language.Dialog(Model.LanguageDialogKey.SAVE_SUCCEED);
// new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
bool result = NeoAlertBox.Show("", text, AlertType.Success, "NEO SCAN", true);
BLLCommon.extension.Update();
}
}
}