Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Exposing methods of an object leads to exception #2

Description

@kpko

Hi, me again.

I tried to register a class with your JurassicExposer.

ScriptEngine engine = new ScriptEngine();            
engine.EnableExposedClrTypes = true;
JurassicExposer.ExposeClass<Form>(engine);

I can instantiate a form via Javascript, but the JurassicExposer by itself does not expose methods as functions to call in JS. So I can't just call form.Show via JS.

I looked at your website and tried to imitate the functionality by creating JurassicInfos for each property.

List<JurassicInfo> infos = new List<JurassicInfo>();

foreach (MethodInfo method in typeof(Form).GetMethods(BindingFlags.Instance | BindingFlags.Public))
{
    infos.Add(new JurassicInfo(method.Name, new JSFunctionAttribute()));
}

JurassicExposer.RegisterInfos<Form>(infos.ToArray());

If I try to run that code, an exception occurs:

image
(Parameter count does not match passed in argument value count.)

Am I doing something wrong here?

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions