Example #1
0
 /// <summary>
 /// Gets the client proxy object for the
 /// specified name.
 /// </summary>
 /// <param name="name">Unique name for the proxy object.</param>
 /// <returns></returns>
 public static ServiceClientManager <C, T> GetManager(string name)
 {
     lock (_lock)
     {
         ServiceClientManager <C, T> mgr = (ServiceClientManager <C, T>)ApplicationContext.LocalContext.GetValueOrNull(name);
         if (mgr == null)
         {
             mgr = new ServiceClientManager <C, T>(name);
             ApplicationContext.LocalContext[name] = mgr;
         }
         return(mgr);
     }
 }
 /// <summary>
 /// Gets the client proxy object for the
 /// specified name.
 /// </summary>
 /// <param name="name">Unique name for the proxy object.</param>
 /// <returns></returns>
 public static ServiceClientManager <C, T> GetManager(string name)
 {
     lock (_lock)
     {
         ServiceClientManager <C, T> mgr = null;
         if (ApplicationContext.LocalContext.Contains(name))
         {
             mgr = (ServiceClientManager <C, T>)(ApplicationContext.LocalContext[name]);
         }
         else
         {
             mgr = new ServiceClientManager <C, T>(name);
             ApplicationContext.LocalContext[name] = mgr;
         }
         return(mgr);
     }
 }