Beispiel #1
0
 public void SetProperty(string propertyName, object value)
 {
     if (value == null)
     {
         _jsValue.SetProperty(propertyName, null);
     }
     else
     {
         using (var variant = new NetVariant())
         {
             Helpers.Pack(value, variant, value.GetType());
             _jsValue.SetProperty(propertyName, variant);
         }
     }
 }
Beispiel #2
0
            public override bool TrySetMember(SetMemberBinder binder, object value)
            {
                if (value == null)
                {
                    _jsValue.SetProperty(binder.Name, null);
                }
                else
                {
                    using (var variant = new NetVariant())
                    {
                        Helpers.PackValue(value, variant);
                        _jsValue.SetProperty(binder.Name, variant);
                    }
                }

                return(true);
            }