IAsyncMethodInterceptorInterceptAsync Method |
Version 104.4.240
Called before an async method is invoked. You are now responsible for evaluating
the function and returning the result. Only methods that return a
Task
will call this method, other non asynchronous types will call
Intercept(FuncObject, Object, Object, String).
(async void method will also call Intercept as they do not return a Task).
Namespace:
CefSharp.ModelBinding
Assembly:
CefSharp (in CefSharp.dll) Version: 104.4.240.0 (104.4.240.0)
Syntax Task<Object> InterceptAsync(
Func<Object[], Object> method,
Object[] parameters,
string methodName
)
Task<Object^>^ InterceptAsync(
Func<array<Object^>^, Object^>^ method,
array<Object^>^ parameters,
String^ methodName
)
Parameters
- method
- Type: SystemFuncObject, Object
A Func that represents the method to be called - parameters
- Type: SystemObject
paramaters to be passed to method - methodName
- Type: SystemString
Name of the method to be called
Return Value
Type:
TaskObjectA Task representing the method result
Examples
Task<object> IAsyncMethodInterceptor.InterceptAsync(Func<object[], object> method, object[] parameters, string methodName)
{
object result = method(parameters);
Debug.WriteLine("Called " + methodName);
return result;
}
See Also