Exemple #1
0
        public override T GetProperty <T>()
        {
            if (typeof(T) == typeof(IChannelListener))
            {
                return((T)(object)innerChannelListener);
            }

            if (typeof(T) == typeof(ISecurityCapabilities) && !this.providesCorrelation)
            {
                return(InternalDuplexBindingElement.GetSecurityCapabilities <T>(base.GetProperty <ISecurityCapabilities>()));
            }

            T baseProperty = base.GetProperty <T>();

            if (baseProperty != null)
            {
                return(baseProperty);
            }

            IChannelListener channelListener = innerChannelListener;

            if (channelListener != null)
            {
                return(channelListener.GetProperty <T>());
            }
            else
            {
                return(default(T));
            }
        }
Exemple #2
0
 public override T GetProperty <T>(BindingContext context)
 {
     if (typeof(T) == typeof(ISecurityCapabilities) && !this.ProvidesCorrelation)
     {
         return(InternalDuplexBindingElement.GetSecurityCapabilities <T>(context.GetInnerProperty <ISecurityCapabilities>()));
     }
     else
     {
         return(context.GetInnerProperty <T>());
     }
 }
        public override T GetProperty <T>() where T : class
        {
            if (typeof(T) == typeof(IChannelFactory))
            {
                return((T)this.innerChannelFactory);
            }
            if ((typeof(T) == typeof(ISecurityCapabilities)) && !this.providesCorrelation)
            {
                return(InternalDuplexBindingElement.GetSecurityCapabilities <T>(base.GetProperty <ISecurityCapabilities>()));
            }
            T property = base.GetProperty <T>();

            if (property != null)
            {
                return(property);
            }
            return(this.innerChannelFactory.GetProperty <T>());
        }