From d3d6907dacdc46dfd83388a364aac9cf58a4094b Mon Sep 17 00:00:00 2001 From: Chris Bardsley Date: Mon, 4 Apr 2016 21:44:22 -0700 Subject: [PATCH] Refactored changes from build#1644 to account for discussed changes. --- CefSharp.Example/BoundObject.cs | 21 ++++++++++++++ CefSharp.Example/Resources/BindingTest.html | 29 +++++++++++++++++++ CefSharp.Example/Resources/Home.html | 8 ----- .../ScriptedMethodsBoundObject.cs | 21 -------------- CefSharp/Internals/JavascriptMethod.cs | 1 - .../Internals/JavascriptObjectRepository.cs | 25 ++++++++++------ CefSharp/Internals/MethodParameter.cs | 16 +++------- NuGet.config | 3 ++ 8 files changed, 73 insertions(+), 51 deletions(-) diff --git a/CefSharp.Example/BoundObject.cs b/CefSharp.Example/BoundObject.cs index 72fccb73a..c5d0656be 100644 --- a/CefSharp.Example/BoundObject.cs +++ b/CefSharp.Example/BoundObject.cs @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; +using System.Linq; using System.Threading.Tasks; namespace CefSharp.Example @@ -270,5 +271,25 @@ namespace CefSharp.Example { return SubObject; } + + /// + /// Demonstrates the use of params as an argument in a bound object + /// + /// Dummy Argument + /// Params Argument + public string MethodWithParams(string name, params object[] args) + { + return String.Join(", ", args.ToArray()); + } + + public string MethodWithoutParams(string name, string arg2) + { + return String.Format("{0}, {1}", name, arg2); + } + + public string methodWithoutAnything() + { + return "Method without anything called and returned successfully."; + } } } diff --git a/CefSharp.Example/Resources/BindingTest.html b/CefSharp.Example/Resources/BindingTest.html index 0caedff02..c08a017da 100644 --- a/CefSharp.Example/Resources/BindingTest.html +++ b/CefSharp.Example/Resources/BindingTest.html @@ -237,5 +237,34 @@ } +

+ Javascript function sending variable number of parameters to Bound Object. (ParamArray Test) + +

+ ParamArray Results +
+ +

diff --git a/CefSharp.Example/Resources/Home.html b/CefSharp.Example/Resources/Home.html index dd8113ee3..0d78795c7 100644 --- a/CefSharp.Example/Resources/Home.html +++ b/CefSharp.Example/Resources/Home.html @@ -351,14 +351,6 @@ objects.

Hooks by which you can modify and/or override certain features of the web browsing

-

- A fix to allow params to be used by the .NET methods called by the javascript
- - - - - -