Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Issue: MetaScriptItem doesnt override GetDynamicMemberNames [64]

0
0
the base implantation of DynamicMetaObject just returns an empty string array.

advise using doing something like what dynamic object does


```
public override IEnumerable<string> GetDynamicMemberNames()
{
return scriptItem.GetDynamicMemberNames();
}
```


test
```
var objWithcolor = engine.Evaluate("x={color:'red'};");
var dynamicProvider = (IDynamicMetaObjectProvider)objWithcolor;
var metaObject = dynamicProvider.GetMetaObject(Expression.Constant(dynamicProvider));
var propNames = metaObject.GetDynamicMemberNames();
Assert.IsTrue(propNames.Any(name => name == "color"));
```

Viewing all articles
Browse latest Browse all 2297