mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-06-18 13:20:09 +10:00
Update about Manager.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user