Update about Manager.

This commit is contained in:
Bruce
2026-01-27 22:47:49 +08:00
parent 5a404a55e3
commit 0c87a2cdcd
52 changed files with 9170 additions and 201 deletions
+29
View File
@@ -4,6 +4,8 @@ using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Reflection;
namespace AppxPackage
{
[Serializable]
@@ -229,4 +231,31 @@ namespace AppxPackage.Info
return a._value < value;
}
}
public static class JSHelper
{
public static void CallJS (object jsFunc, params object [] args)
{
if (jsFunc == null) return;
try
{
// 这里固定第一个参数为 thisArg(比如 1)
object [] realArgs = new object [args.Length + 1];
realArgs [0] = jsFunc; // thisArg
Array.Copy (args, 0, realArgs, 1, args.Length);
jsFunc.GetType ().InvokeMember (
"call",
BindingFlags.InvokeMethod,
null,
jsFunc,
realArgs
);
}
catch
{
// ignore errors in callback invocation
}
}
}
}