Ejemplo n.º 1
0
 public void AssignTo(object target)
 {
     foreach (string field in Fields)
     {
         IMemberBind bind = RuntimeHost.Binder.BindToMember(target, field, false);
         if (bind != null)
         {
             bind.SetValue(fields[field]);
         }
         //RuntimeHost.Binder.Set(field, target, fields[field], false);
     }
 }
Ejemplo n.º 2
0
        private void SetMember(IScriptContext context, object obj, object value)
        {
            IMemberBind bind = RuntimeHost.Binder.BindToMember(obj, Identifier, true);

            if (bind == null)
            {
                throw new ScriptIdNotFoundException(Identifier);
            }

            bind.SetValue(value);
            context.Result = value;

            //Context.Result = RuntimeHost.Binder.Set(Identifier, obj, value);
        }