{"action":"created","issue":{"url":"https://api.github.com/repos/sebastienros/jint/issues/224","labels_url":"https://api.github.com/repos/sebastienros/jint/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/sebastienros/jint/issues/224/comments","events_url":"https://api.github.com/repos/sebastienros/jint/issues/224/events","html_url":"https://github.com/sebastienros/jint/issues/224","id":106185538,"number":224,"title":"Passing C# *instance* methods to javascript","user":{"login":"AtmoEntity","id":1180782,"avatar_url":"https://avatars.githubusercontent.com/u/1180782?v=3","gravatar_id":"","url":"https://api.github.com/users/AtmoEntity","html_url":"https://github.com/AtmoEntity","followers_url":"https://api.github.com/users/AtmoEntity/followers","following_url":"https://api.github.com/users/AtmoEntity/following{/other_user}","gists_url":"https://api.github.com/users/AtmoEntity/gists{/gist_id}","starred_url":"https://api.github.com/users/AtmoEntity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtmoEntity/subscriptions","organizations_url":"https://api.github.com/users/AtmoEntity/orgs","repos_url":"https://api.github.com/users/AtmoEntity/repos","events_url":"https://api.github.com/users/AtmoEntity/events{/privacy}","received_events_url":"https://api.github.com/users/AtmoEntity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-12T21:23:06Z","updated_at":"2015-09-13T02:21:43Z","closed_at":null,"body":"I see in the documentation (and unit tests) an abundance of examples on binding static functions, but I can't find anything on binding methods on instances. E.g.:\r\n\r\n```C#\r\n// Egg.cs\r\npublic class Egg\r\n{\r\n    public void Hatch() { Console.WriteLine(\"Hatching!\"); }\r\n    public void Die() { Console.WriteLine(\"Dying :(\"); }\r\n}\r\n```\r\n\r\n```javascript\r\n// javascript\r\n\r\n// these are global functions\r\nHatch();\r\nDie();\r\n```\r\n\r\nAnd the output would of course be:\r\n\r\n```\r\nHatching!\r\nDying :(\r\n```\r\n\r\nAnother similar question, is there a way to pass a single object instance directly to javascript? So for example if I have this C# code:\r\n\r\n```C#\r\ngraphics = new CustomGraphicsWrapper(magicalGraphicsLibrary);\r\n```\r\n\r\nThat I can pass it to javascript so I could do:\r\n\r\n```javascript\r\ngraphics.drawImage( ... );\r\n```"},"comment":{"url":"https://api.github.com/repos/sebastienros/jint/issues/comments/139839911","html_url":"https://github.com/sebastienros/jint/issues/224#issuecomment-139839911","issue_url":"https://api.github.com/repos/sebastienros/jint/issues/224","id":139839911,"user":{"login":"sebastienros","id":1165805,"avatar_url":"https://avatars.githubusercontent.com/u/1165805?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastienros","html_url":"https://github.com/sebastienros","followers_url":"https://api.github.com/users/sebastienros/followers","following_url":"https://api.github.com/users/sebastienros/following{/other_user}","gists_url":"https://api.github.com/users/sebastienros/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastienros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastienros/subscriptions","organizations_url":"https://api.github.com/users/sebastienros/orgs","repos_url":"https://api.github.com/users/sebastienros/repos","events_url":"https://api.github.com/users/sebastienros/events{/privacy}","received_events_url":"https://api.github.com/users/sebastienros/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T02:21:43Z","updated_at":"2015-09-13T02:21:43Z","body":"And you don't even have to define `egg` in the Engine:\r\n\r\n`e.setValue(\"Hatch\", () => egg.Hatch());`"}}