object IInstance.CreateInstance() { var overrideCountable = Builder.New().Object(GetCount: new Func <int>(OverrideCount)); var targetSelector = new DictionaryTargetSelectorBuilder { { typeof(ILongCountable), a, false }, { typeof(ICountable), Impromptu.ActLike <ICountable>(overrideCountable) }, { typeof(IContainsCountable), this } }.Create(); return((IContainsCountable)Mixins.GenerateProxy(targetSelector)); }
object IInstance.CreateInstance() { var targetSelector = new DictionaryTargetSelectorBuilder { { typeof(ILongCountable), a, false }, { typeof(ICountable), AnonymousInterface.Implement <ICountable>(new { get_Count = new Func <int>(OverrideCount) }) .Add(x => x.GetCount(), new Func <int>(OverrideCount)) //.Add(x => x.GetType(), null) .Create() }, { typeof(IContainsCountable), this } }.Create(); AnonymousInterface.Implement <ITest>() .Add(x => x.valg, new Func <int>(() => 17)) .Add(x => x[0], new Func <int, int>(y => y)); return((IContainsCountable)Mixins.GenerateProxy(targetSelector)); }