/// <summary> /// Passes Javascript requests from the IBridgeHandler instances to the browser /// </summary> /// <param name="sender">The IBridgeHandler asking for the Javascript execution</param> /// <param name="eventArgs">The arguments of this event</param> /// <returns></returns> protected virtual object BridgeHandler_PushJavascript(IBridgeHandler sender, PushJavascriptEventArgs eventArgs) { if (!Contains(sender) || string.IsNullOrWhiteSpace(eventArgs.Script)) { return(null); } if ((eventArgs.Target != null) && (eventArgs.Target != this)) { return(null); } if (eventArgs.Callback != null) { ExecuteJavascript(eventArgs.Script, eventArgs.Callback); return(null); } if (eventArgs.FireAway) { FireJavascript(eventArgs.Script); return(null); } return(ExecuteJavascript(eventArgs.Script)); }
/// <summary> /// Raises the <see cref="PushJavascript" /> event using provided arguments /// </summary> /// <param name="eventArgs">The arguments to be used to raise <see cref="PushJavascript" /> event</param> /// <returns>Returns the result of raising <see cref="PushJavascript" /> event</returns> protected virtual object OnPushJavascript(PushJavascriptEventArgs eventArgs) { return(PushJavascript?.Invoke(this, eventArgs)); }
/// <summary> /// Raises the <see cref="PushJavascript" /> event using provided arguments /// </summary> /// <param name="sender">The IBridgeHandler instance that raised the event</param> /// <param name="eventArgs">The arguments to be used to raise <see cref="PushJavascript" /> event</param> /// <returns>Returns the result of raising <see cref="PushJavascript" /> event</returns> protected virtual object OnPushJavascript(IBridgeHandler sender, PushJavascriptEventArgs eventArgs) { return(PushJavascript?.Invoke(this, eventArgs)); }