private static T Subscribe <T>(WcfClientModel <T> clientModel, Action <AdHocChannelFactoryAware> subscribe) where T : WcfClientModel <T>
        {
            var adHoc = new AdHocChannelFactoryAware();

            subscribe(adHoc);
            return(clientModel.AddExtensions(adHoc));
        }
 public static T OnChannelAvailable <T>(this WcfClientModel <T> clientModel, Action <ChannelFactory, IChannel> action) where T : WcfClientModel <T>
 {
     return(Subscribe <T>(clientModel, adHoc => adHoc.OnChannelAvailable(action)));
 }
 public static T OnFaulted <T>(this WcfClientModel <T> clientModel, Action <ChannelFactory> action) where T : WcfClientModel <T>
 {
     return(Subscribe <T>(clientModel, adHoc => adHoc.OnFaulted(action)));
 }