August
28th,
2007
After writing my last post, I realized that an even better way to do this is to actually formalize the binding as a custom binding:
public class OneWayBinding : CustomBinding
{
public OneWayBinding(Binding baseBinding)
: base(baseBinding)
{
}
public override BindingElementCollection CreateBindingElements()
{
BindingElementCollection bec = base.CreateBindingElements();
bec.Insert(0, new OneWayBindingElement());
return bec;
}
}
Then you can simply say:
CustomBinding binding = new OneWayBinding(new NetTcpBinding());
Technorati tags: Windows Communication Foundation