Closed Diaskhan closed 6 years ago
1.Its possible to pass object and call there methods ?
obj1 = new Circle(5,5); fle.variables.add(obj1) fle.eval("obj1.SomeMethod()");
2.Supporting anonymous types ?
dynamic MyDynamic = new System.Dynamic.ExpandoObject(); MyDynamic.A = "A"; MyDynamic.B = "B"; MyDynamic.C = "C"; MyDynamic.Number = 12; MyDynamic.MyMethod = new Func<int>(() => { return 55; }); Console.WriteLine(MyDynamic.MyMethod());
`obj1 = new Circle(5,5); fle.variables.add(obj1) fle.eval("obj1.SomeMethod()");`
`obj1 = new Circle(5,5);
fle.variables.add(obj1)
fle.eval("obj1.SomeMethod()");`
You can achieve #1 by setting obj1 as the expression owner—do this by passing it to the constructor of the expression evaluator.
1.Its possible to pass object and call there methods ?
2.Supporting anonymous types ?