|
@@ -0,0 +1,38 @@
|
|
|
+using fis.Utilities;
|
|
|
+using System.Collections.Generic;
|
|
|
+
|
|
|
+
|
|
|
+namespace fis.Win
|
|
|
+{
|
|
|
+ internal class JsContentConvert
|
|
|
+ {
|
|
|
+ private const string _notificationName = "externalNotification";
|
|
|
+
|
|
|
+ public static string GetExcuteJsContent(TargetMethodName targetMethodName, List<string> arguments)
|
|
|
+ {
|
|
|
+ string callString = _notificationName + "(";
|
|
|
+ if (arguments != null)
|
|
|
+ {
|
|
|
+ string comma = ", ";
|
|
|
+ var argumentsStr = "";
|
|
|
+ int index = 0;
|
|
|
+ foreach (var e in arguments)
|
|
|
+ {
|
|
|
+ if (index == arguments.Count - 1)
|
|
|
+ {
|
|
|
+ argumentsStr += e;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ argumentsStr += e + "&";
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ var escaped = System.Web.HttpUtility.JavaScriptStringEncode(argumentsStr, true);
|
|
|
+ callString += (int)targetMethodName + comma + escaped + comma + "";
|
|
|
+ }
|
|
|
+ callString += ");";
|
|
|
+ return callString;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|