public override void Set(JsDictionaryObject that, JsInstance value)
        {
            object[] nativeValue = JsClr.ConvertParameters(value);
            System.Reflection.PropertyInfo pi = getter.GetValue(that.Value, Name, nativeValue);

            object val = nativeValue [0];

            if (!pi.PropertyType.Equals(val.GetType()))
            {
                Type t = pi.PropertyType;
                if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable <>))
                {
                    t = Nullable.GetUnderlyingType(t);
                }
                val = Convert.ChangeType(val, t);
            }

            pi.SetValue(that.Value, val, null);
        }
Exemple #2
0
 public override void Set(JsDictionaryObject that, JsInstance value)
 {
     object[] nativeValue = JsClr.ConvertParameters(value);
     getter.GetValue(that.Value, Name, nativeValue).SetValue(that.Value, nativeValue[0], null);
 }