本文整理汇总了C#中HttpTransportBindingElement.CanBuildChannelListener方法的典型用法代码示例。如果您正苦于以下问题:C# HttpTransportBindingElement.CanBuildChannelListener方法的具体用法?C# HttpTransportBindingElement.CanBuildChannelListener怎么用?C# HttpTransportBindingElement.CanBuildChannelListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpTransportBindingElement
的用法示例。
在下文中一共展示了HttpTransportBindingElement.CanBuildChannelListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanBuildChannelListener
public void CanBuildChannelListener ()
{
// with HttpTransport
var m = new WebMessageEncodingBindingElement ();
Assert.IsFalse (m.CanBuildChannelListener<IRequestChannel> (CreateBindingContext ()), "#1");
Assert.IsTrue (m.CanBuildChannelListener<IReplyChannel> (CreateBindingContext ()), "#2");
Assert.IsFalse (m.CanBuildChannelListener<IRequestSessionChannel> (CreateBindingContext ()), "#3");
Assert.IsFalse (m.CanBuildChannelListener<IDuplexChannel> (CreateBindingContext ()), "#4");
// actually they are from transport
var h = new HttpTransportBindingElement ();
Assert.IsFalse (h.CanBuildChannelListener<IRequestChannel> (CreateBindingContext ()), "#5");
Assert.IsTrue (h.CanBuildChannelListener<IReplyChannel> (CreateBindingContext ()), "#6");
Assert.IsFalse (h.CanBuildChannelListener<IRequestSessionChannel> (CreateBindingContext ()), "#7");
Assert.IsFalse (h.CanBuildChannelListener<IDuplexChannel> (CreateBindingContext ()), "#8");
// with TcpTransport
Assert.IsFalse (m.CanBuildChannelListener<IRequestChannel> (CreateBindingContext2 ()), "#9");
Assert.IsFalse (m.CanBuildChannelListener<IReplyChannel> (CreateBindingContext2 ()), "#10");
Assert.IsFalse (m.CanBuildChannelListener<IRequestSessionChannel> (CreateBindingContext2 ()), "#11");
Assert.IsFalse (m.CanBuildChannelListener<IDuplexChannel> (CreateBindingContext2 ()), "#12");
// ... yes, actually they are from transport
var t = new TcpTransportBindingElement ();
Assert.IsFalse (t.CanBuildChannelListener<IRequestChannel> (CreateBindingContext2 ()), "#13");
Assert.IsFalse (t.CanBuildChannelListener<IReplyChannel> (CreateBindingContext2 ()), "#14");
Assert.IsFalse (t.CanBuildChannelListener<IRequestSessionChannel> (CreateBindingContext2 ()), "#15");
Assert.IsFalse (t.CanBuildChannelListener<IDuplexChannel> (CreateBindingContext2 ()), "#16");
}
示例2: CanBuildChannelListener
public void CanBuildChannelListener ()
{
HttpTransportBindingElement be =
new HttpTransportBindingElement ();
BindingContext ctx = new BindingContext (
new CustomBinding (), empty_params);
Assert.IsTrue (be.CanBuildChannelListener<IReplyChannel> (ctx), "#1");
Assert.IsFalse (be.CanBuildChannelListener<IOutputChannel> (ctx), "#2");
Assert.IsFalse (be.CanBuildChannelListener<IRequestChannel> (ctx), "#3");
Assert.IsFalse (be.CanBuildChannelListener<IInputChannel> (ctx), "#4");
// seems like it does not support session channels by itself ?
Assert.IsFalse (be.CanBuildChannelListener<IReplySessionChannel> (ctx), "#5");
Assert.IsFalse (be.CanBuildChannelListener<IOutputSessionChannel> (ctx), "#6");
Assert.IsFalse (be.CanBuildChannelListener<IRequestSessionChannel> (ctx), "#7");
Assert.IsFalse (be.CanBuildChannelListener<IInputSessionChannel> (ctx), "#8");
// IServiceChannel is not supported
Assert.IsFalse (be.CanBuildChannelListener<IServiceChannel> (ctx), "#9");
}