/// <summary> /// Register a new <see cref="IConnectionCallbackHandler"/>. /// </summary> /// <param name="handler">The callback handler.</param> public static void RegisterCallback(IConnectionCallbackHandler handler) { if (handler?.WorkingConnection == null) { throw new NullReferenceException("Callback handler not configured correctly."); } if (WorkingHandlers.ContainsKey(handler.WorkingConnection)) { WorkingHandlers[handler.WorkingConnection] = handler; } else { WorkingHandlers.Add(handler.WorkingConnection, handler); } }
/// <summary> /// Registers a <see cref="IConnectionCallbackHandler"/>. /// </summary> /// <param name="handler">The output handler.</param> public void RegisterConnectionCallback(IConnectionCallbackHandler handler) => ConnectionCallbackProvider.RegisterCallback(handler);
public void RegisterCallbackHandler(IConnectionCallbackHandler handler) => CallbackHandler = handler;