first commit

This commit is contained in:
2026-01-07 11:33:05 +08:00
commit fc54ffd43b
215 changed files with 31856 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.ComponentModel;
using System.Reflection;
using System.Windows.Forms;
namespace ICSharpCode.TextEditor.Extensions
{
public static class ControlExtensions
{
public static EventHandlerList GetEventHandlerList(this Control c)
{
return GetEventHandlerListInternal(c);
}
public static EventHandlerList GetEventHandlerList(this Component c)
{
return GetEventHandlerListInternal(c);
}
private static EventHandlerList GetEventHandlerListInternal(object obj)
{
Type type = obj.GetType();
PropertyInfo pi = type.GetProperty("Events", BindingFlags.NonPublic | BindingFlags.Instance);
return (EventHandlerList)pi.GetValue(obj, null);
}
}
}