public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            MessageVersion message = context.GetInnerProperty <MessageVersion>();

            if (message.Addressing == AddressingVersion.None)
            {
                return(false);
            }

            if (typeof(TChannel) == typeof(IDuplexChannel))
            {
                return(context.CanBuildInnerChannelFactory <IRequestChannel>());
            }

            if (typeof(TChannel) == typeof(IDuplexSessionChannel))
            {
                return(context.CanBuildInnerChannelFactory <IRequestSessionChannel>());
            }

            return(false);
        }
Beispiel #2
0
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     VerifyEncodingMessageVersion(context);
     if (typeof(IOutputChannel) == typeof(TChannel))
     {
         return(context.CanBuildInnerChannelFactory <IRequestChannel>());
     }
     else
     {
         return(context.CanBuildInnerChannelFactory <TChannel>());
     }
 }
Beispiel #3
0
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     return(context.CanBuildInnerChannelFactory <TChannel>());
 }
Beispiel #4
0
        public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw new ArgumentException("context", "Context cannot be null, please pass a BindingContext!");
            }

            return(context.CanBuildInnerChannelFactory <TChannel>());
        }
        public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(context));
            }

            return(context.CanBuildInnerChannelFactory <TChannel>());
        }
Beispiel #6
0
        void Snippet11()
        {
            // <Snippet11>
            CustomBinding binding              = new CustomBinding();
            BindingParameterCollection bpCol   = new BindingParameterCollection();
            BindingContext             context = new BindingContext(binding, bpCol);

            context.CanBuildInnerChannelFactory <IDuplexChannel>();
            // </Snippet11>
        }
Beispiel #7
0
        public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            Utility.IfNullThrowNullArgumentException(context, "context");
            if (typeof(TChannel) == typeof(IDuplexChannel))
            {
                return(context.CanBuildInnerChannelFactory <TChannel>());
            }

            return(false);
        }
        internal bool InternalCanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context"));
            }

            context.BindingParameters.Add(this);
            return(context.CanBuildInnerChannelFactory <TChannel>());
        }
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     if (IsSupportedChannelShape(typeof(TChannel)))
     {
         return(context.CanBuildInnerChannelFactory <TChannel>());
     }
     return(false);
 }
        /// <summary>
        /// Used by the higher layers to determine what types of channel factories this
        /// binding element supports.
        /// </summary>
        public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (IsBindingHttp(context.Binding) &&
                typeof(TChannel) == typeof(IRequestSessionChannel) &&
                context.CanBuildInnerChannelFactory <IRequestChannel>())
            {
                return(true);
            }

            return(false);
        }
Beispiel #11
0
        public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw FxTrace.Exception.ArgumentNull("context");
            }

            if (typeof(TChannel) == typeof(IOutputChannel) ||
                typeof(TChannel) == typeof(IDuplexChannel) ||
                typeof(TChannel) == typeof(IRequestChannel) ||
                typeof(TChannel) == typeof(IOutputSessionChannel) ||
                typeof(TChannel) == typeof(IRequestSessionChannel) ||
                typeof(TChannel) == typeof(IDuplexSessionChannel))
            {
                return(context.CanBuildInnerChannelFactory <TChannel>());
            }

            return(false);
        }
        public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ThrowIfNotHttpTransport(context.Binding);

            if (typeof(TChannel) != typeof(IRequestSessionChannel))
            {
                throw new ArgumentException("HttpCookieSessionBindingElement only supports IRequestSessionChannel Factories.", "TChannel");
            }

            if (!context.CanBuildInnerChannelFactory <IRequestChannel>())
            {
                throw new InvalidOperationException(
                          "HttpCookieSessionBindingElement must be stacked on top of a channel that supports IRequestChannel.");
            }

            return((IChannelFactory <TChannel>)(object) new HttpCookieSessionChannelFactory(this, context));
        }
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     context.BindingParameters.Add(this);
     return(context.CanBuildInnerChannelFactory <TChannel>());
 }
Beispiel #14
0
 public override bool CanBuildChannelFactory <T> (BindingContext ctx)
 {
     return(ctx.CanBuildInnerChannelFactory <T> ());
 }
Beispiel #15
0
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     // Return true if it is a request channel and the rest of the call stack supports this type of channel.
     return(typeof(TChannel) == typeof(IRequestChannel) && context.CanBuildInnerChannelFactory <TChannel>());
 }
 public override bool CanBuildChannelFactory <TChannel>(
     BindingContext context)
 {
     ValidateTransport(context.Binding);
     return(context.CanBuildInnerChannelFactory <TChannel>());
 }
Beispiel #17
0
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     return(context.CanBuildInnerChannelFactory <TChannel>());
 }
Beispiel #18
0
 public override bool CanBuildChannelFactory <TChannel>(BindingContext context)
 {
     return(typeof(TChannel) == typeof(IDuplexSessionChannel) && context.CanBuildInnerChannelFactory <TChannel>());
 }