Skip to content

How to invoke a delegate #479

Answered by hyzx86
hyzx86 asked this question in Q&A
Discussion options

You must be logged in to vote

Done, it works 😊

         var engine = new V8ScriptEngine();
            var methods = scriptingManager.GlobalMethodProviders.SelectMany(x => x.GetMethods());
            if (extraMethods != null)
            {
                methods = methods.Concat(extraMethods);
            }
            foreach (var method in methods)
            {
                engine.Script[method.Name]=method.Method(serviceProvider);
            }
            return engine;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hyzx86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant