예제 #1
0
파일: Sandbox.cs 프로젝트: dlurton/Happy
        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);
        }
예제 #2
0
 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;
     }
 }