Files
cefsharp/CefSharp/ModelBinding/IMethodInterceptor.cs
T
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00

32 lines
1.2 KiB
C#

// 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="methodName">Name of the method to be called</param>
/// <returns>The method result</returns>
/// <example>
/// object IMethodInterceptor.Intercept(Func&lt;object&gt; method, string methodName)
/// {
/// object result = method();
/// Debug.WriteLine("Called " + methodName);
/// return result;
/// }
/// </example>
object Intercept(Func<object> method, string methodName);
}
}