admin
2020-06-10 a610f2ab6e543d2cb78c1ef212ac6a74ddc067d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright © 2017 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
 
using System;
 
namespace CefSharp.ModelBinding
{
    /// <summary>
    /// Provides the capability intercept Net method calls made from javascript as part of the
    /// JavascriptBinding (JSB) implementation. One example use case is logging method calls.
    /// </summary>
    public interface IMethodInterceptor
    {
        /// <summary>
        /// Called before the method is invokved. You are now responsible for evaluating
        /// the function and returning the result.
        /// </summary>
        /// <param name="method">A Func that represents the method to be called</param>
        /// <param name="parameters">paramaters to be passed to <paramref name="method"/></param>
        /// <param name="methodName">Name of the method to be called</param>
        /// <returns>The method result</returns>
        /// <example>
        /// 
        /// object IMethodInterceptor.Intercept(Func&lt;object[], object&gt; method, object[] parameters, string methodName)
        /// {
        ///   object result = method(parameters);
        ///   Debug.WriteLine("Called " + methodName);
        ///   return result;
        ///  }
        /// </example>
        object Intercept(Func<object[], object> method, object[] parameters, string methodName);
    }
}