public MemberRename(object instance, string original, string newName) { Instance = instance; oldMember = RuntimeHost.Binder.BindToMember(instance, original, true); if (oldMember == null) throw new ScriptIdNotFoundException(original); this.newName = newName; this.original = original; }
public override IMemberBind GetMember(string name, params object[] arguments) { IMemberBind bind = RuntimeHost.Binder.BindToMember(instance, name, true); if (bind != null) { return(bind); } return(base.GetMember(name, arguments)); }
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); } }
public MemberRename(object instance, string original, string newName) { Instance = instance; oldMember = RuntimeHost.Binder.BindToMember(instance, original, true); if (oldMember == null) { throw new ScriptIdNotFoundException(original); } this.newName = newName; this.original = original; }
private static object GetMemberValue(object obj, string memberInfo) { IMemberBind bind = RuntimeHost.Binder.BindToMember(obj, memberInfo, true); if (bind == null) { throw new ScriptIdNotFoundException(memberInfo); } return(bind.GetValue()); //return RuntimeHost.Binder.Get(memberInfo, obj); }
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); }