PureKrome / EcmaScript.NET

C# Port of the Java EcmaScript project.
Other
15 stars 14 forks source link

Constructor for T not found. #10

Closed HakanKaraoglu closed 3 years ago

HakanKaraoglu commented 4 years ago

Hi, I have a class in the example below

public class ScriptableFeeder : ScriptableObject
    {
        public ScriptableFeeder() {}

                public override string ClassName => "ScriptableFeeder";

        public string name { get; set; }
        public string username { get; set; }
        public int klout { get; set; }
        public int followercount { get; set; }
    }

When I add the part below, I get this error : Constructor for "ScriptableFeeder" not found.

ScriptableObject.getClassPrototype(prototype, typeof(ScriptableFeeder).Name);

ScriptableFeeder feederScope = (ScriptableFeeder)context.NewObject(scope, "ScriptableFeeder");
feederScope.username = "Hakan";
feederScope.name = "Hakan";
feederScope.klout = 1;
feederScope.followercount = 100;

Can you help me? Where do I go wrong in this class?

I'm converting the java rhino application to .net. I'm trying to replicate the part below.

This java code:

ScriptableObject.defineClass(prototype, ScriptableFeeder.class);
ScriptableFeeder feederScope = (ScriptableFeeder) context.newObject(scope, "ScriptableFeeder");
PureKrome commented 4 years ago

Hi @HakanKaraoglu - thank you kindly for posting the issue.

This repo is really really old now. I've not contributed to it for .. like .. ever. I don't expect anyone else to, also.

I also can't answer your question because i've not looked at Rhino or EcmaScript stuff for ages too. So just want to make sure your expectations are met.

I'm sorry I can't be of any help. There might be another person/people who might be able to help though. But, I doubt it. This is old code, now.

I wish you luck in your journey!

HakanKaraoglu commented 4 years ago

Hello @PureKrome

First of all, thank you very much for the quick reply. Yes, it's been a long time, but I'm trying to convert an old project (java to .net kernel) to a new version. Unfortunately, rhino is used somewhere in the java application. For this, I was looking for a library that could do the same. I came across your repo :)

Thank you so much :)

PureKrome commented 4 years ago

No problems at all. I do wish you good fortune in getting some help and answers, though. GL my friend!

PureKrome commented 3 years ago

Closing this issue as this repo is now Archived.