I am making a scripting program using MS ClearScript. I would like to be able to reference to a property indirectly without having to type out the value member of my class.
Here is my class:
namespace WpfApp1
{
public class TagIO
{
public string name { get; set; }
public int value { get; set; }
}
}
I create a collection and add the hostobjects to the scriptengine as the following:
ObservableCollection<TagIO> InputCollection = new ObservableCollection<TagIO>();
foreach (var InputTag in InputCollection)
{
if (InputTag != null)
scriptEngine.AddHostObject(InputTag.name, InputTag);
}
I can run a script with the following line:
a.value = b.value;
But I would like to improve this so that I can do the following:
a = b;