public void TestUsingOnlySources() { IBusinessObject obj = new BusinessObject(); BindingPairHolder bindingPairHolder = new BindingPairHolder(); using (BindingScope scope = new BindingScope(bindingPairHolder)) { IBusinessObject source = scope.CreateSource(obj); Assert.IsNull(bindingPairHolder.ConsumeBindingPair()); string name = source.Name; BindingPair pair = bindingPairHolder.ConsumeBindingPair(); Assert.IsNotNull(pair); Assert.AreEqual(obj, pair.Object); Assert.AreEqual("Name", pair.Member); short number = source.ShortValue; BindingPair anotherPair = bindingPairHolder.ConsumeBindingPair(); Assert.IsNotNull(anotherPair); Assert.AreEqual(obj, anotherPair.Object); Assert.AreEqual("ShortValue", anotherPair.Member); } }
/// <summary> /// Constructs a new abstract binding. /// </summary> /// <param name="bindingPairHolder">The binding pair holder to use for the binding.</param> protected AbstractBinding(BindingPairHolder bindingPairHolder) { this.bindingPairHolder = bindingPairHolder; }
public DynamicProxyInterceptor(IBindingScope scope, object original, BindingPairHolder bindingPairHolder) { this.scope = scope; proxied = original; this.bindingPairHolder = bindingPairHolder; }