Exemplo n.º 1
0
 public static async Task RippleEffect(
     IJSRuntime jsRuntime,
     object reference,
     object rippleSettings)
 {
     try
     {
         await CellBaseUtils.InvokeMethod(jsRuntime, "cellBlazor.callRipple", reference, rippleSettings);
     }
     catch (Exception ex)
     {
         object obj = await LogError <object>(jsRuntime, ex);
     }
 }
Exemplo n.º 2
0
 public static async Task Animate(
     IJSRuntime jsRuntime,
     object reference,
     object animationSettings)
 {
     try
     {
         await CellBaseUtils.InvokeMethod(jsRuntime, "cellBlazor.animate", reference, animationSettings);
     }
     catch (Exception ex)
     {
         object obj = await LogError <object>(jsRuntime, ex);
     }
 }
Exemplo n.º 3
0
 public static async ValueTask <T> SetTemplateInstance <T>(
     IJSRuntime jsRuntime,
     string templateName,
     DotNetObjectReference <object> helper,
     int guid)
 {
     try
     {
         return(await CellBaseUtils.InvokeMethod <T>(jsRuntime, "cellBlazor.setTemplateInstance", (object)templateName, (object)helper, (object)guid));
     }
     catch (Exception ex)
     {
         return(await LogError <T>(jsRuntime, ex));
     }
 }
Exemplo n.º 4
0
 public static ValueTask <T> InvokeGet <T>(
     IJSRuntime jsRuntime,
     string id,
     string moduleName,
     string methodName,
     string nameSpace)
 {
     try
     {
         return(CellBaseUtils.InvokeMethod <T>(jsRuntime, "cellBlazor.getMethodCall", (object)id, (object)moduleName, (object)methodName));
     }
     catch (Exception ex)
     {
         string message = nameSpace + " - #" + id + " - getMethodCall had public server error \n";
         return(LogError <T>(jsRuntime, ex, message));
     }
 }
        public async Task <T> InvokeMethod <T>(
            string methodName,
            bool isObjectReturnType,
            params object[] methodParams)
        {
            if (!isObjectReturnType)
            {
                return(await CellBaseUtils.InvokeMethod <T>(this.JSRuntime, methodName, methodParams));
            }
            string str = await CellBaseUtils.InvokeMethod <string>(this.JSRuntime, methodName, methodParams);

            T obj = default(T);

            if (str != null)
            {
                obj = JsonConvert.DeserializeObject <T>(str, new JsonSerializerSettings()
                {
                    NullValueHandling     = NullValueHandling.Ignore,
                    MissingMemberHandling = MissingMemberHandling.Ignore
                });
            }
            return(obj);
        }
 public async Task InvokeMethod(string methodName, params object[] methodParams) => await CellBaseUtils.InvokeMethod(this.JSRuntime, methodName, methodParams);