public void test4() { dynamic foo2 = new ExpandoObject(); var callSiteBinder = new HappySetMemberBinder("Bar"); CallSite<Func<CallSite, object, int, object>> callSite = CallSite<Func<CallSite, object, int, object>>.Create(callSiteBinder); callSite.Target(callSite, foo2, 1); Assert.AreEqual(1, foo2.Bar); }
public override SetMemberBinder CreateSetMemberBinder(string name, bool ignoreCase) { lock (_setMemberBinders) { if (_setMemberBinders.ContainsKey(name)) return _setMemberBinders[name]; var b = new HappySetMemberBinder(name); _setMemberBinders[name] = b; return b; } }