增加修改删除页面,增加COM口的配置等
This commit is contained in:
1 parent
f3110791a7
commit
e96e2d3651
89 files changed
+10692
-727
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WindowsFormsApp1.server
|
||||
{
|
||||
public static class FormHelp
|
||||
{
|
||||
public static void RemoveAllEventHandlers(object obj, string eventName)
|
||||
{
|
||||
Type type = obj.GetType();
|
||||
EventInfo eventInfo = type.GetEvent(eventName);
|
||||
if (eventInfo != null)
|
||||
{
|
||||
FieldInfo fieldInfo = type.GetField(eventName, BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (fieldInfo != null)
|
||||
{
|
||||
fieldInfo.SetValue(obj, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user