Exemplo n.º 1
0
 /// <summary>Invokes a method on the channel.</summary>
 /// <param name="action">The action to perform.</param>
 protected virtual void InvokeMethod(Action <T> action)
 {
     if (HasOpenChannel)
     {
         action(m_channel.Client);
     }
     else
     {
         ServiceClientFactory.InvokeMethod <T>(action, CreateInstance);
     }
 }
Exemplo n.º 2
0
 /// <summary>Invokes a method on the channel.</summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="action">The action to perform.</param>
 protected virtual TResult InvokeMethod <TResult> (Func <T, TResult> action)
 {
     return(HasOpenChannel ? action(m_channel.Client) : ServiceClientFactory.InvokeMethod <T, TResult>(action, CreateInstance));
 }
Exemplo n.º 3
0
 /// <summary>Creates an instance of the client wrapper.</summary>
 /// <returns>The client wrapper.</returns>
 protected virtual ServiceClientWrapper <T> CreateInstance()
 {
     return(ServiceClientFactory.CreateAndWrap <T>());
 }