public static NotificationListener Start(INotifyCallback callback, TimeSpan retryDelay, TimeSpan openTimeout, TimeSpan sendTimeout, TimeSpan receiveTimeout) { Exception ex = null; ExTraceGlobals.ThirdPartyClientTracer.TraceDebug(0L, "NotificationListener is starting."); NotificationListener notificationListener = new NotificationListener(); try { notificationListener.m_retryDelay = retryDelay; notificationListener.m_openTimeout = openTimeout; notificationListener.m_sendTimeout = sendTimeout; notificationListener.m_receiveTimeout = receiveTimeout; notificationListener.SetupNotifyHost(callback); ReplayCrimsonEvents.TPRNotificationListenerStarted.Log(); ExTraceGlobals.ThirdPartyClientTracer.TraceDebug(0L, "NotificationListener was started successfully."); notificationListener.SendTimeouts(); return(notificationListener); } catch (CommunicationException ex2) { ex = ex2; } catch (Exception ex3) { ex = ex3; } if (ex != null) { ReplayCrimsonEvents.TPRNotificationListenerFailedToStart.Log <string>(ex.Message); ExTraceGlobals.ThirdPartyClientTracer.TraceError <Exception>(0L, "NotificationListener failed to start: {0}", ex); throw ex; } return(null); }
public NotifyService(INotifyCallback callback, NotificationListener listener) { this.m_callback = callback; this.m_listener = listener; }