示例#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;
     }
 }