Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ee2815f3
由
刘韬
编写于
2024-05-06 16:51:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
下拉框支持动态帅选内容
1 个父辈
402a8ef0
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
67 行增加
和
1 行删除
BLL/BLL.csproj
BLL/DebounceHelper.cs
BLL/Extension.cs
BLL/Extension/Item_General.cs
SharedDll/Asa.Face.Control.dll
BLL/BLL.csproj
查看文件 @
ee2815f
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
<Compile Include="Camera.cs" />
<Compile Include="Camera.cs" />
<Compile Include="Config.cs" />
<Compile Include="Config.cs" />
<Compile Include="ConvertBarcode.cs" />
<Compile Include="ConvertBarcode.cs" />
<Compile Include="DebounceHelper.cs" />
<Compile Include="Extension.cs" />
<Compile Include="Extension.cs" />
<Compile Include="Extension\Item_Alcoelectro.cs" />
<Compile Include="Extension\Item_Alcoelectro.cs" />
<Compile Include="Extension\EventGroup.cs" />
<Compile Include="Extension\EventGroup.cs" />
...
...
BLL/DebounceHelper.cs
0 → 100644
查看文件 @
ee2815f
using
System
;
using
System.Windows.Forms
;
public
class
DebounceHelper
<
T1
,
T2
>
{
private
Timer
timer
;
public
event
EventHandler
<
T2
>
DebouncedTextChanged
;
T1
Object
;
T2
Value
;
public
DebounceHelper
(
int
debounceInterval
)
{
timer
=
new
Timer
();
timer
.
Interval
=
debounceInterval
;
timer
.
Tick
+=
Timer_Tick
;
}
public
void
HandleTextChanged
(
T1
obj
,
T2
value
)
{
Object
=
obj
;
Value
=
value
;
timer
.
Stop
();
timer
.
Start
();
}
private
void
Timer_Tick
(
object
sender
,
EventArgs
e
)
{
timer
.
Stop
();
DebouncedTextChanged
?.
Invoke
(
Object
,
Value
);
}
}
\ No newline at end of file
\ No newline at end of file
BLL/Extension.cs
查看文件 @
ee2815f
...
@@ -151,6 +151,13 @@ namespace BLL
...
@@ -151,6 +151,13 @@ namespace BLL
}
}
}
}
};
};
if
(
type
==
"ComboBox"
)
{
//(new ComboBox).TextChanged
R
.
Add
(
"Event"
,
new
Dictionary
<
string
,
object
>()
{
{
"TextChanged"
,
"ComboBoxTextChanged"
}
});
}
listrow
.
Add
(
new
object
[]
{
L
,
R
});
listrow
.
Add
(
new
object
[]
{
L
,
R
});
}
}
Dictionary
<
string
,
object
>
A
=
new
()
Dictionary
<
string
,
object
>
A
=
new
()
...
...
BLL/Extension/Item_General.cs
查看文件 @
ee2815f
...
@@ -41,13 +41,34 @@ namespace BLL
...
@@ -41,13 +41,34 @@ namespace BLL
macroKey
.
AddRange
(
lines
);
macroKey
.
AddRange
(
lines
);
}
}
}
}
private
DebounceHelper
<
FaceComboBox
,
string
>
debounceHelper
;
public
General
(
Config
config
)
public
General
(
Config
config
)
{
{
this
.
config
=
config
;
this
.
config
=
config
;
ReadMacro
();
ReadMacro
();
debounceHelper
=
new
DebounceHelper
<
FaceComboBox
,
string
>(
500
);
// 设置抗抖动的间隔,单位为毫秒
debounceHelper
.
DebouncedTextChanged
+=
DebounceHelper_DebouncedTextChanged
;
;
}
private
void
DebounceHelper_DebouncedTextChanged
(
object
sender
,
string
e
)
{
var
s
=
sender
as
Asa
.
FaceControl
.
FaceComboBox
;
//if (s.Text == e)
// return;
s
.
Items
.
Clear
();
var
data
=
ExtraFileData
.
DataTitle
.
Where
(
a
=>
a
.
Contains
(
e
))
.
Distinct
()
.
OrderBy
(
tit
=>
tit
)
.
ToArray
();
s
.
Items
.
AddRange
(
data
);
//s.SelectedIndex = -1;
//s.Enabled = true;
//s.Text = e;
}
}
public
void
Clear
()
public
void
Clear
()
{
{
LogNet
.
log
.
Info
(
"Clear()"
);
LogNet
.
log
.
Info
(
"Clear()"
);
...
@@ -341,6 +362,12 @@ namespace BLL
...
@@ -341,6 +362,12 @@ namespace BLL
{
{
updatereelid
(
lastkey
,
out
_
);
updatereelid
(
lastkey
,
out
_
);
}
}
private
void
ComboBoxTextChanged
(
object
sender
,
EventArgs
e
)
{
var
txt
=
((
FaceComboBox
)
sender
).
Text
;
debounceHelper
.
HandleTextChanged
((
FaceComboBox
)
sender
,
txt
);
}
private
void
PrintLabel
(
object
sender
,
EventArgs
e
)
private
void
PrintLabel
(
object
sender
,
EventArgs
e
)
{
{
LogNet
.
log
.
Info
(
"Enter PrintLabel Method"
);
LogNet
.
log
.
Info
(
"Enter PrintLabel Method"
);
...
...
SharedDll/Asa.Face.Control.dll
查看文件 @
ee2815f
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论