Ejemplo n.º 1
0
 private void WireInvocationEventHandlers()
 {
     foreach (ProxyableService service in ServiceClients)
     {
         ServiceProxyClient client = service.Property <ServiceProxyClient>("Client");
         client.InvocationException += (o, a) => InvocationExceptionHandler(o, a);
         client.InvokedMethod       += (o, a) => InvocationHandler(o, a);
     }
 }
Ejemplo n.º 2
0
        private static void SubscribeToInvocationExceptions <T>(T result, EventHandler <ServiceProxyInvokeEventArgs> invocationExceptionHandler)
        {
            ServiceProxyClient client = result.Property <ServiceProxyClient>("Client"); // Client is defined on the generated proxy class, and this is using reflection to access it; magical knowledge

            client.Subscribe(nameof(ServiceProxyClient.InvocationException), invocationExceptionHandler);
        }