Example #1
0
        bool SetProperty(Experiment ex, PropertyAccess p, object value, bool notifyui = false)
        {
            object v = value.Convert(p.Type);

            p.Setter(ex, v);
            if (notifyui)
            {
                OnNotifyUI?.Invoke(p.Name, v);
            }
            return(true);
        }
Example #2
0
        static Experiment()
        {
            var T = typeof(Experiment);

            Properties = new Dictionary <string, PropertyAccess>();
            foreach (var p in T.GetProperties())
            {
                var n = p.Name;
                Properties[n] = new PropertyAccess(p.PropertyType, n,
                                                   T.DelegateForGetPropertyValue(n), T.DelegateForSetPropertyValue(n));
            }
        }
Example #3
0
 object GetProperty(Experiment ex, PropertyAccess p)
 {
     return(p.Getter(ex));
 }