This project has moved and is read-only. For the latest updates, please go here.

Handle access to element by index

Aug 13, 2014 at 5:31 PM
I am trying to create a simple object-wrapper for html DOM and pass it to Script Engine as a global value.
I have one issue which I can't solve.
There is explanation of my issue with example:
var eng = new ScriptEngine();
HtmlDom html = new HtmlDom(doc);
eng.SetGlobalValue("document", html); 
my js file contains line
HtmlDom class has property forms of DomElementsType.
DomElementsType is derived from DynamicObject.
I expected to override TryGetIndex in DomElementsType and implement logic here to return element which I need, but this function doesn't get call.
Also I tried to create indexer function
public DomElementsType this[int index]
there is logic to return certain element

Result the same.
I can't just use array, because form object should support Submit function for example.

How I can accomplish my goal?
Aug 14, 2014 at 1:48 PM
Issue solved.
I just inherited objects which I pass to Script engine from ObjectInstance or ArrayInstance and overrode method GetMissingPropertyValue
Marked as answer by Gdocal on 8/14/2014 at 5:48 AM